Fixes: shouldForceJHBuild isn't called
authorArnaud Renevier <a.renevier@samsung.com>
Wed, 4 Nov 2015 18:34:57 +0000 (10:34 -0800)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 07:55:23 +0000 (07:55 +0000)
shouldForceJHBuild is never called in build_desktop.sh
Also, bash function have an exit value, but do not return a value that
can be used as-is in test condition.

So as a fix, instead of checking for the return value, we delete the
stamp file inside the method if needed. The method is now named
forceJHBuildIfNeeded.

Reviewed by: a1.gomes

Change-Id: Ib9374e99990fc9dbef16d51158967273ed9ccd30
Signed-off-by: Arnaud Renevier <a.renevier@samsung.com>
tizen_src/build/build_desktop.sh

index 45b8fb0..576a2c6 100755 (executable)
@@ -15,18 +15,19 @@ parseHostBuildScriptParams desktop $@
 
 JHBUILD_STAMPFILE="${GYP_GENERATOR_OUTPUT}/Dependencies/Root/jhbuild.stamp"
 
-shouldForceJHBuild() {
+forceJHBuildIfNeeded() {
   if [[ $FORCE_JHBUILD == 1 ]]; then
-    return 1
+    rm -f $JHBUILD_STAMPFILE
+    return
   fi
 
   # Check if anything in jhbuild is more recent than stamp file.
-  return $(find $SCRIPTDIR/jhbuild -type f -newer $JHBUILD_STAMPFILE -print | wc -l)
+  if [ $(find $SCRIPTDIR/jhbuild -type f -newer $JHBUILD_STAMPFILE -print | wc -l) != "0" ]; then
+    rm -f $JHBUILD_STAMPFILE
+  fi
 }
 
-if [[ $(shouldForceJHBuild) > 0 ]]; then
-  rm -f $JHBUILD_STAMPFILE
-fi
+forceJHBuildIfNeeded
 
 JHBUILD_DEPS="${GYP_GENERATOR_OUTPUT}/Dependencies/Root"
 if [ "${host_arch}" == "x64" ]; then