Bug 1405068: Don't use Cwd::abs_path in unwrap_full_update.pl. draft
authorTom Prince <mozilla@hocat.ca>
Mon, 02 Oct 2017 12:25:05 -0600
changeset 673751 702502e7288038253f8bb5d48a5f4e1a8d1d0238
parent 673750 1db6137fafd8452f66647456aa646dbd63bc16a7
child 734136 9c8686a7097c31982047f076e352171aa7b11332
push id82629
push userbmo:mozilla@hocat.ca
push dateMon, 02 Oct 2017 18:32:33 +0000
bugs1405068
milestone58.0a1
Bug 1405068: Don't use Cwd::abs_path in unwrap_full_update.pl. It is broken on the version of perl on the legacy buildbots, which is the only place that this branch of the code runs. MozReview-Commit-ID: 1Urw6mNOEHf
tools/update-packaging/unwrap_full_update.pl
--- a/tools/update-packaging/unwrap_full_update.pl
+++ b/tools/update-packaging/unwrap_full_update.pl
@@ -7,17 +7,16 @@
 # This tool unpacks a full update package generated by make_full_update.sh
 # Author: Benjamin Smedberg
 #
 
 # -----------------------------------------------------------------------------
 # By default just assume that these tools exist on our path
 
 use Getopt::Std;
-use Cwd 'abs_path';
 
 my ($MAR, $XZ, $BZIP2, $MAR_OLD_FORMAT, $archive, @marentries, @marfiles);
 
 if (defined($ENV{"MAR"})) {
     $MAR = $ENV{"MAR"};
 }
 else {
     $MAR = "mar";
@@ -31,28 +30,35 @@ else {
 }
 
 if (defined($ENV{"XZ"})) {
     $XZ = $ENV{"XZ"};
 }
 else {
     if (system("xz --version > /dev/null 2>&1") != 0) {
         # Some of the Windows build systems have xz.exe in topsrcdir/xz/.
-        my $xzwinpath = abs_path(__FILE__);
+        my $xzwinpath = __FILE__;
         $xzwinpath = substr($xzwinpath, 0, rindex($xzwinpath, '/'));
         $xzwinpath = substr($xzwinpath, 0, rindex($xzwinpath, '/'));
         $xzwinpath = substr($xzwinpath, 0, rindex($xzwinpath, '/'));
-        $xzwinpath = $xzwinpath . "/xz/xz.exe";
-        if (-e $xzwinpath) {
-            $XZ = $xzwinpath;
+        my $xzwin = $xzwinpath . "/xz/xz.exe";
+        if (-e $xzwin) {
+            $XZ = $xzwin;
         }
         else {
-            # If the xz executable was not found fallback to trying to execute
-            # xz and follow the normal failure path if it isn't found.
-            $XZ = "xz";
+            $xzwinpath = substr($xzwinpath, 0, rindex($xzwinpath, '/'));
+            $xzwin = $xzwinpath . "/xz/xz.exe";
+            if (-e $xzwin) {
+                $XZ = $xzwin;
+            }
+            else {
+                # If the xz executable was not found fallback to trying to execute
+                # xz and follow the normal failure path if it isn't found.
+                $XZ = "xz";
+            }
         }
     }
     else {
         $XZ = "xz";
     }
 }
 
 sub print_usage