Bug 815963 - Use a more specific pattern to make ../../dist/bin to ../../dist. r=dhylands
authorAlan Huang <ahuang@mozilla.com>
Fri, 07 Dec 2012 13:59:34 +0800
changeset 124602 2011a8b835ebe728fd5588b7c966023907c71566
parent 124601 f020328109720b1b8a61b0d27e4bf118d4484b9b
child 124603 da39c8eae21295f9749c2320f30142902f6cdc31
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdhylands
bugs815963
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 815963 - Use a more specific pattern to make ../../dist/bin to ../../dist. r=dhylands Otherwise, it causes the build break when B2G root path contains bin/.
toolkit/mozapps/installer/Packager.pm
--- a/toolkit/mozapps/installer/Packager.pm
+++ b/toolkit/mozapps/installer/Packager.pm
@@ -295,18 +295,25 @@ sub do_copyfile
         print " dir copy w/o altdest: $destpath $destname $destsuffix\n";
     } else {  # single file copy, no altdest
       ($destname, $destpath, $destsuffix) = fileparse("$destpathcomp/$line", '\..*?$');
       ($debug >= 5) &&
         print " file copy w/o altdest: $destpath $destname $destsuffix\n";
     }
   }
 
+  # Translate: */../../*/bin/*
+  #      into: */../../*/*
+  # (where the *'s are interpreted using shell-notation and
+  #  it matches not only forward slashes but also backslashes.)
+  # $1 = */../../*/
+  # $2 = bin/
+  # $3 = *
   if ($flat) {
-    $destpath =~ s|bin[/\\]||;
+    $destpath =~ s|(.*[/\\]\.\.[/\\]\.\.[/\\].+[/\\])(bin[/\\])(.*)|$1$3|;
   }
 
   # create the destination path if it doesn't exist
   if (! -d "$destpath" ) {
     ($debug >= 5) && print " mkpath($destpath)\n";
     # For OS/2 - remove trailing '/'
     chop($destpath);
     mkpath ($destpath, 0, 0755) ||