Mac v2 signing - Bug 1074044 - Force add instead of patch the removed-files file. r=nthomas
authorRobert Strong <robert.bugzilla@gmail.com>
Mon, 29 Sep 2014 00:45:12 -0700
changeset 491295 a421eebeaf620a82a7054287e361ce8bb7eb25c4
parent 491294 467e710dcd379ee71d8f853eca3b5f628381221c
child 491296 2d7fc305953f13756ec498f237c5e2eb28b73d49
push id47343
push userbmo:dothayer@mozilla.com
push dateWed, 01 Mar 2017 22:58:58 +0000
reviewersnthomas
bugs1074044
milestone35.0a1
Mac v2 signing - Bug 1074044 - Force add instead of patch the removed-files file. r=nthomas
tools/update-packaging/make_incremental_update.sh
tools/update-packaging/make_incremental_updates.py
--- a/tools/update-packaging/make_incremental_update.sh
+++ b/tools/update-packaging/make_incremental_update.sh
@@ -35,18 +35,27 @@ check_for_forced_update() {
     return 0;
   fi
 
   if [ "$forced_file_chk" = "Contents/Resources/precomplete" ]; then
     ## "true" *giggle*
     return 0;
   fi
 
-  if [ "${forced_file_chk##*.}" = "chk" ]
-  then
+  if [ "$forced_file_chk" = "removed-files" ]; then
+    ## "true" *giggle*
+    return 0;
+  fi
+
+  if [ "$forced_file_chk" = "Contents/Resources/removed-files" ]; then
+    ## "true" *giggle*
+    return 0;
+  fi
+
+  if [ "${forced_file_chk##*.}" = "chk" ]; then
     ## "true" *giggle*
     return 0;
   fi
 
   for f in $force_list; do
     #echo comparing $forced_file_chk to $f
     if [ "$forced_file_chk" = "$f" ]; then
       ## "true" *giggle*
--- a/tools/update-packaging/make_incremental_updates.py
+++ b/tools/update-packaging/make_incremental_updates.py
@@ -299,17 +299,17 @@ def process_explicit_remove_files(dir_pa
     found in that file to the patch_info"""
 
     # Windows and linux have this file at the root of the dir
     list_file_path = os.path.join(dir_path, "removed-files")
     if not os.path.exists(list_file_path):
         list_file_path = os.path.join(dir_path, "Contents/Resources/removed-files")
 
     if (os.path.exists(list_file_path)):
-        list_file = open(list_file_path,"r") # throws if doesn't exist
+        list_file = bz2.BZ2File(list_file_path,"r") # throws if doesn't exist
 
         lines = []
         for line in list_file:
             lines.append(line.strip())
         list_file.close()
 
         lines.sort(reverse=True)
         for line in lines:
@@ -326,27 +326,35 @@ def create_partial_patch(from_dir_path, 
     from_dir_path = os.path.abspath(from_dir_path)
     to_dir_path = os.path.abspath(to_dir_path)
     # Create a hashtable of the from  and to directories
     from_dir_hash,from_file_set,from_dir_set = patch_info.build_marfile_entry_hash(from_dir_path)
     to_dir_hash,to_file_set,to_dir_set = patch_info.build_marfile_entry_hash(to_dir_path)
     # Create a list of the forced updates
     forced_list = forced_updates.strip().split('|')
     # Require that the precomplete file is included in the complete update
-    if "precomplete" not in to_file_set:
-        # The check with \ file separators allows tests for Mac to run on Windows
-        if "Contents/Resources/precomplete" not in to_file_set and "Contents\Resources\precomplete" not in to_file_set:
-            raise Exception, "missing precomplete file in: "+to_dir_path
-        else:
-            if "Contents/Resources/precomplete" in to_file_set:
-                forced_list.append("Contents/Resources/precomplete")
-            else:
-                forced_list.append("Contents\Resources\precomplete")
+    if "precomplete" in to_file_set:
+        forced_list.append("precomplete")
+    elif "Contents/Resources/precomplete" in to_file_set:
+        forced_list.append("Contents/Resources/precomplete")
+    # The check with \ file separators allows tests for Mac to run on Windows
+    elif "Contents\Resources\precomplete" in to_file_set:
+        forced_list.append("Contents\Resources\precomplete")
     else:
-        forced_list.append("precomplete")
+        raise Exception, "missing precomplete file in: "+to_dir_path
+
+    if "removed-files" in to_file_set:
+        forced_list.append("removed-files")
+    elif "Contents/Resources/removed-files" in to_file_set:
+        forced_list.append("Contents/Resources/removed-files")
+    # The check with \ file separators allows tests for Mac to run on Windows
+    elif "Contents\Resources\\removed-files" in to_file_set:
+        forced_list.append("Contents\Resources\\removed-files")
+    else:
+        raise Exception, "missing removed-files file in: "+to_dir_path
 
     # Files which exist in both sets need to be patched
     patch_filenames = list(from_file_set.intersection(to_file_set))
     patch_filenames.sort(reverse=True)
     for filename in patch_filenames:
         from_marfile_entry = from_dir_hash[filename]
         to_marfile_entry = to_dir_hash[filename]
         if os.path.basename(filename) in add_if_not_list: