Bug 841094 - Don't special-case extensions/ and searchplugins/ directories when creating complete and partial mar, but special-case distribution/extensions. r=rstrong,r=bhearsum,a=bajaj
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 20 Feb 2013 16:48:58 +0100
changeset 132204 8f571fa8ec14d315c1a9ff0aca71330fd303b2c8
parent 132203 6fce4468d80fc27a171b0f7d75cf88f7516a738e
child 132205 d492919c068b61b1608d46db3fc380ed7220bb4f
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrstrong, bhearsum, bajaj
bugs841094
milestone21.0a2
Bug 841094 - Don't special-case extensions/ and searchplugins/ directories when creating complete and partial mar, but special-case distribution/extensions. r=rstrong,r=bhearsum,a=bajaj
tools/update-packaging/common.sh
tools/update-packaging/make_incremental_updates.py
tools/update-packaging/test/common.sh
--- a/tools/update-packaging/common.sh
+++ b/tools/update-packaging/common.sh
@@ -42,42 +42,38 @@ make_add_instruction() {
 
   # Used to log to the console
   if [ $2 ]; then
     forced=" (forced)"
   else
     forced=
   fi
 
-  is_extension=$(echo "$f" | grep -c 'extensions/.*/')
+  is_extension=$(echo "$f" | grep -c 'distribution/extensions/.*/')
   if [ $is_extension = "1" ]; then
     # Use the subdirectory of the extensions folder as the file to test
     # before performing this add instruction.
-    testdir=$(echo "$f" | sed 's/\(extensions\/[^\/]*\)\/.*/\1/')
+    testdir=$(echo "$f" | sed 's/\(.*distribution\/extensions\/[^\/]*\)\/.*/\1/')
     notice "     add-if: $f$forced"
     echo "add-if \"$testdir\" \"$f\""
   else
     notice "        add: $f$forced"
     echo "add \"$f\""
   fi
 }
 
 make_patch_instruction() {
   f="$1"
-  is_extension=$(echo "$f" | grep -c 'extensions/.*/')
-  is_search_plugin=$(echo "$f" | grep -c 'searchplugins/.*')
+  is_extension=$(echo "$f" | grep -c 'distribution/extensions/.*/')
   if [ $is_extension = "1" ]; then
     # Use the subdirectory of the extensions folder as the file to test
     # before performing this add instruction.
-    testdir=$(echo "$f" | sed 's/\(extensions\/[^\/]*\)\/.*/\1/')
+    testdir=$(echo "$f" | sed 's/\(.*distribution\/extensions\/[^\/]*\)\/.*/\1/')
     notice "   patch-if: $f"
     echo "patch-if \"$testdir\" \"$f.patch\" \"$f\""
-  elif [ $is_search_plugin = "1" ]; then
-    notice "   patch-if: $f"
-    echo "patch-if \"$f\" \"$f.patch\" \"$f\""
   else
     notice "      patch: $f"
     echo "patch \"$f.patch\" \"$f\""
   fi
 }
 
 append_remove_instructions() {
   dir="$1"
--- a/tools/update-packaging/make_incremental_updates.py
+++ b/tools/update-packaging/make_incremental_updates.py
@@ -32,57 +32,47 @@ class PatchInfo:
         self.archive_files=[]
         self.manifestv1=[]
         self.manifestv2=[]
         self.file_exclusion_list=file_exclusion_list
         self.path_exclusion_list=path_exclusion_list
         
     def append_add_instruction(self, filename):
         """ Appends an add instruction for this patch.   
-            if the filename starts with extensions/ adds an add-if instruction
-            to test the existence of the subdirectory.  This was ported from
-            mozilla/tools/update-packaging/common.sh/make_add_instruction
+            if the filename starts with distribution/extensions/ adds an add-if
+            instruction to test the existence of the subdirectory.  This was
+            ported from mozilla/tools/update-packaging/common.sh's
+            make_add_instruction.
         """
-        if filename.startswith("extensions/"):
+        m = re.match("((?:|.*/)distribution/extensions)/", filename):
+        if m:
             # Directory immediately following extensions is used for the test
-            testdir = "extensions/"+filename.split("/")[1]
-            self.manifestv1.append('add-if "'+testdir+'" "'+filename+'"')
-            self.manifestv2.append('add-if "'+testdir+'" "'+filename+'"')
-        elif filename.startswith("Contents/MacOS/extensions/"):
-            testdir = "Contents/MacOS/extensions/"+filename.split("/")[3]
+            testdir = m.group(1)
             self.manifestv1.append('add-if "'+testdir+'" "'+filename+'"')
             self.manifestv2.append('add-if "'+testdir+'" "'+filename+'"')
         else:
             self.manifestv1.append('add "'+filename+'"')
             self.manifestv2.append('add "'+filename+'"')
            
     def append_patch_instruction(self, filename, patchname):
         """ Appends an patch instruction for this patch.   
             
             filename = file to patch
             patchname = patchfile to apply to file
             
-            if the filename starts with extensions/ adds a patch-if instruction
-            to test the existence of the subdirectory.  
-            if the filename starts with searchplugins/ add a add-if instruction for the filename
+            if the filename starts with distribution/extensions/ adds a
+            patch-if instruction to test the existence of the subdirectory.  
             This was ported from
-            mozilla/tools/update-packaging/common.sh/make_patch_instruction
+            mozilla/tools/update-packaging/common.sh's make_patch_instruction.
         """
-        if filename.startswith("extensions/"):
-            testdir = "extensions/"+filename.split("/")[1]
+        m = re.match("((?:|.*/)distribution/extensions)/", filename):
+        if m:
+            testdir = m.group(1)
             self.manifestv1.append('patch-if "'+testdir+'" "'+patchname+'" "'+filename+'"')
             self.manifestv2.append('patch-if "'+testdir+'" "'+patchname+'" "'+filename+'"')
-        elif filename.startswith("Contents/MacOS/extensions/"):
-            testdir = "Contents/MacOS/extensions/"+filename.split("/")[3]
-            self.manifestv1.append('patch-if "'+testdir+'" "'+patchname+'" "'+filename+'"')
-            self.manifestv2.append('patch-if "'+testdir+'" "'+patchname+'" "'+filename+'"')
-        elif (filename.startswith("searchplugins/") or
-             filename.startswith("Contents/MacOS/searchplugins/")):
-            self.manifestv1.append('patch-if "'+filename+'" "'+patchname+'" "'+filename+'"')
-            self.manifestv2.append('patch-if "'+filename+'" "'+patchname+'" "'+filename+'"')
         else:
             self.manifestv1.append('patch "'+patchname+'" "'+filename+'"')
             self.manifestv2.append('patch "'+patchname+'" "'+filename+'"')
                 
     def append_remove_instruction(self, filename):
         """ Appends an remove instruction for this patch.   
             This was ported from
             mozilla/tools/update-packaging/common.sh/make_remove_instruction
--- a/tools/update-packaging/test/common.sh
+++ b/tools/update-packaging/test/common.sh
@@ -39,42 +39,38 @@ make_add_instruction() {
 
   # Used to log to the console
   if [ $2 ]; then
     forced=" (forced)"
   else
     forced=
   fi
 
-  is_extension=$(echo "$f" | grep -c 'extensions/.*/')
+  is_extension=$(echo "$f" | grep -c 'distribution/extensions/.*/')
   if [ $is_extension = "1" ]; then
     # Use the subdirectory of the extensions folder as the file to test
     # before performing this add instruction.
-    testdir=$(echo "$f" | sed 's/\(extensions\/[^\/]*\)\/.*/\1/')
+    testdir=$(echo "$f" | sed 's/\(.*distribution\/extensions\/[^\/]*\)\/.*/\1/')
     notice "     add-if: $f$forced"
     echo "add-if \"$testdir\" \"$f\""
   else
     notice "        add: $f$forced"
     echo "add \"$f\""
   fi
 }
 
 make_patch_instruction() {
   f="$1"
-  is_extension=$(echo "$f" | grep -c 'extensions/.*/')
-  is_search_plugin=$(echo "$f" | grep -c 'searchplugins/.*')
+  is_extension=$(echo "$f" | grep -c 'distribution/extensions/.*/')
   if [ $is_extension = "1" ]; then
     # Use the subdirectory of the extensions folder as the file to test
     # before performing this add instruction.
-    testdir=$(echo "$f" | sed 's/\(extensions\/[^\/]*\)\/.*/\1/')
+    testdir=$(echo "$f" | sed 's/\(.*distribution\/extensions\/[^\/]*\)\/.*/\1/')
     notice "   patch-if: $f"
     echo "patch-if \"$testdir\" \"$f.patch\" \"$f\""
-  elif [ $is_search_plugin = "1" ]; then
-    notice "   patch-if: $f"
-    echo "patch-if \"$f\" \"$f.patch\" \"$f\""
   else
     notice "      patch: $f"
     echo "patch \"$f.patch\" \"$f\""
   fi
 }
 
 append_remove_instructions() {
   dir="$1"