Force jhbuild rebuild if needed
authorBalazs Kelemen <b.kelemen@samsung.com>
Tue, 28 Oct 2014 23:26:46 +0000 (19:26 -0400)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 06:57:09 +0000 (06:57 +0000)
We added stamp file as build time optimization but that should not stop jhbuild
if config files are changed. Also moving the stamp file to Root directory
so that clobbering jhbuild will also force rebuild.

Bug: http://107.108.218.239/bugzilla/show_bug.cgi?id=6110
Reviewed by:  Yi Shen, SeungSeop Park

Change-Id: Idc0939030c51b1941420abc250ce58ee055a5be6
Signed-off-by: Balazs Kelemen <b.kelemen@samsung.com>
tizen_src/build/build_desktop.sh

index d79162e..99b47b0 100755 (executable)
@@ -58,9 +58,24 @@ if echo "$@" | grep -cq '\-\-build_ewk_unittests'; then
   BUILD_EWK_UNITTESTS=1
 fi
 
-JHBUILD_STAMPFILE="${GYP_GENERATOR_OUTPUT}/Dependencies/jhbuild.stamp"
+JHBUILD_STAMPFILE="${GYP_GENERATOR_OUTPUT}/Dependencies/Root/jhbuild.stamp"
 
-if echo "$@" | grep -cq '\-\-force-jhbuild'; then
+shouldForceJHBuild() {
+  if echo "$@" | grep -cq '\-\-force-jhbuild'; then
+    return 1
+  fi
+
+  # Check if anything in jhbuild is more recent than stamp file.
+  for i in $(find "$SCRIPTDIR/jhbuild"); do
+    if [ -f "$i" -a "$JHBUILD_STAMPFILE" -ot "$i" ]; then
+      return 1
+    fi
+  done
+
+  return 0
+}
+
+if [ "$(shouldForceJHBuild $@)" == "1" ]; then
   rm -f $JHBUILD_STAMPFILE
 fi