Bug 1405068: Look for xz.exe at the root of a checkout when making incremental updates. draft
authorTom Prince <mozilla@hocat.ca>
Mon, 02 Oct 2017 11:59:36 -0600
changeset 673749 735c2274b539ac9ef56dc07b1f5e3941fb33d5b2
parent 673329 97efdde466f18cf580fda9673cf4c38ee21fc7b7
child 673750 1db6137fafd8452f66647456aa646dbd63bc16a7
push id82629
push userbmo:mozilla@hocat.ca
push dateMon, 02 Oct 2017 18:32:33 +0000
bugs1405068
milestone58.0a1
Bug 1405068: Look for xz.exe at the root of a checkout when making incremental updates. MozReview-Commit-ID: 8R5kY8cntMc
tools/update-packaging/common.sh
--- a/tools/update-packaging/common.sh
+++ b/tools/update-packaging/common.sh
@@ -11,19 +11,31 @@
 # -----------------------------------------------------------------------------
 # By default just assume that these tools exist on our path
 MAR=${MAR:-mar}
 MBSDIFF=${MBSDIFF:-mbsdiff}
 if [[ -z "${MAR_OLD_FORMAT}" ]]; then
   XZ=${XZ:-xz}
   $XZ --version > /dev/null 2>&1
   if [ $? -ne 0 ]; then
-    echo "xz was not found on this system!"
-    echo "exiting"
-    exit 1
+    # If $XZ is not set and not found on the path then this is probably
+    # running on a windows buildbot. Some of the Windows build systems have
+    # xz.exe in topsrcdir/xz/. Look in the places this would be in both a
+    # mozilla-central and comm-central build.
+    XZ="$(dirname "$(dirname "$(dirname "$0")")")/xz/xz.exe"
+    $XZ --version > /dev/null 2>&1
+    if [ $? -ne 0 ]; then
+      XZ="$(dirname "$(dirname "$(dirname "$(dirname "$0")")")")/xz/xz.exe"
+      $XZ --version > /dev/null 2>&1
+      if [ $? -ne 0 ]; then
+        echo "xz was not found on this system!"
+        echo "exiting"
+        exit 1
+      fi
+    fi
   fi
 else
   MAR_OLD_FORMAT=1
   BZIP2=${BZIP2:-bzip2}
 fi
 
 # -----------------------------------------------------------------------------
 # Helper routines