RelEng patch - Bug 660038 - Remove channel switching support. r=nthomas
authorRobert Strong <robert.bugzilla@gmail.com>
Wed, 18 Jan 2012 14:10:25 -0800
changeset 84845 e527c2b55f5c09b5cd0a8d6d81bd90cd8b83269d
parent 84844 97b424c630e7f0664ea66de1e5e39c4dcbf3f140
child 84846 2175dcb4ca0b0c0157e9bb9b38b6cbee945317ae
push idunknown
push userunknown
push dateunknown
reviewersnthomas
bugs660038
milestone12.0a1
RelEng patch - Bug 660038 - Remove channel switching support. r=nthomas
config/createprecomplete.py
tools/update-packaging/make_full_update.sh
tools/update-packaging/make_incremental_update.sh
tools/update-packaging/test/make_full_update.sh
--- a/config/createprecomplete.py
+++ b/config/createprecomplete.py
@@ -1,32 +1,34 @@
 # Any copyright is dedicated to the Public Domain.
 # http://creativecommons.org/publicdomain/zero/1.0/
 
-# Creates the precomplete file containing the remove, remove-cc, and rmdir
-# application update instructions which is used to remove files and directories
-# that are no longer present in a complete update. The current working directory
-# is used for the location to enumerate and to create the precomplete file.
+# Creates the precomplete file containing the remove and rmdir application
+# update instructions which is used to remove files and directories that are no
+# longer present in a complete update. The current working directory is used for
+# the location to enumerate and to create the precomplete file.
 
 import sys
 import os
 
 def get_build_entries(root_path):
     """ Iterates through the root_path, creating a list for each file and
-        directory. Excludes any path starting with extensions or distribution.
+        directory. Excludes any path starting with extensions or distribution
+        and paths ending with channel-prefs.js.
     """
     rel_file_path_set = set()
     rel_dir_path_set = set()
     for root, dirs, files in os.walk(root_path):
         for file_name in files:
             parent_dir_rel_path = root[len(root_path)+1:]
             rel_path_file = os.path.join(parent_dir_rel_path, file_name)
             rel_path_file = rel_path_file.replace("\\", "/")
             if not (rel_path_file.startswith("distribution/") or
-                    rel_path_file.startswith("extensions/")):
+                    rel_path_file.startswith("extensions/") or
+                    rel_path_file.endswith("channel-prefs.js")):
                 rel_file_path_set.add(rel_path_file)
 
         for dir_name in dirs:
             parent_dir_rel_path = root[len(root_path)+1:]
             rel_path_dir = os.path.join(parent_dir_rel_path, dir_name)
             rel_path_dir = rel_path_dir.replace("\\", "/")+"/"
             if not (rel_path_dir.startswith("distribution/") or
                     rel_path_dir.startswith("extensions/")):
@@ -35,34 +37,31 @@ def get_build_entries(root_path):
     rel_file_path_list = list(rel_file_path_set)
     rel_file_path_list.sort(reverse=True)
     rel_dir_path_list = list(rel_dir_path_set)
     rel_dir_path_list.sort(reverse=True)
 
     return rel_file_path_list, rel_dir_path_list
 
 def generate_precomplete():
-    """ Creates the precomplete file containing the remove, remove-cc, and rmdir
+    """ Creates the precomplete file containing the remove and rmdir
         application update instructions. The current working directory is used
         for the location to enumerate and to create the precomplete file.
     """
     root_path = os.getcwd()
     # If inside a Mac bundle use the root of the bundle for the path.
     if os.path.basename(root_path) == "MacOS":
         root_path = os.path.abspath(os.path.join(root_path, '../../'))
 
     rel_file_path_list, rel_dir_path_list = get_build_entries(root_path)
     precomplete_file_path = os.path.join(root_path,"precomplete")
     # open in binary mode to prevent OS specific line endings.
     precomplete_file = open(precomplete_file_path, "wb")
     for rel_file_path in rel_file_path_list:
-        if rel_file_path.endswith("channel-prefs.js"):
-            precomplete_file.writelines("remove-cc \""+rel_file_path+"\"\n")
-        else:
-            precomplete_file.writelines("remove \""+rel_file_path+"\"\n")
+        precomplete_file.writelines("remove \""+rel_file_path+"\"\n")
 
     for rel_dir_path in rel_dir_path_list:
         precomplete_file.writelines("rmdir \""+rel_dir_path+"\"\n")
 
     precomplete_file.close()
 
 if __name__ == "__main__":
     generate_precomplete()
--- a/tools/update-packaging/make_full_update.sh
+++ b/tools/update-packaging/make_full_update.sh
@@ -56,19 +56,16 @@ fi
 
 if [ ! -f "precomplete" ]; then
   notice "precomplete file is missing!"
   exit 1
 fi
 
 list_files files
 
-# Files that should be added on channel change
-ccfiles=$(find . -type f -name "channel-prefs.js" | sed 's/\.\/\(.*\)/\1/')
-
 popd
 
 notice ""
 notice "Adding file add instructions to file 'update.manifest'"
 > $updatemanifestv1
 
 num_files=${#files[*]}
 
@@ -89,29 +86,16 @@ done
 # 1 update manifest to the version 2 update manifest.
 > $updatemanifestv2
 notice ""
 notice "Adding type instruction to file 'updatev2.manifest'"
 notice "       type: complete"
 echo "type \"complete\"" >> $updatemanifestv2
 
 notice ""
-notice "Adding file ADD instructions for channel change to file 'updatev2.manifest'"
-for f in $ccfiles; do
-  notice "     add-cc: $f"
-  echo "add-cc \"$f\"" >> $updatemanifestv2
-  dir=$(dirname "$f")
-  mkdir -p "$workdir/$dir"
-  $BZIP2 -cz9 "$targetdir/$f" > "$workdir/$f"
-  copy_perm "$targetdir/$f" "$workdir/$f"
-
-  targetfiles="$targetfiles \"$f\""
-done
-
-notice ""
 notice "Concatenating file 'update.manifest' to file 'updatev2.manifest'"
 cat $updatemanifestv1 >> $updatemanifestv2
 
 # Append remove instructions for any dead files.
 notice ""
 notice "Adding file and directory remove instructions from file 'removed-files'"
 append_remove_instructions "$targetdir" "$updatemanifestv1" "$updatemanifestv2"
 
--- a/tools/update-packaging/make_incremental_update.sh
+++ b/tools/update-packaging/make_incremental_update.sh
@@ -110,19 +110,16 @@ fi
 if [ ! -f "precomplete" ]; then
   notice "precomplete file is missing!"
   exit 1
 fi
 
 list_dirs newdirs
 list_files newfiles
 
-# Files that should be added on channel change
-ccfiles=$(find . -type f -name "channel-prefs.js" | sed 's/\.\/\(.*\)/\1/')
-
 popd
 
 notice ""
 notice "Adding file patch and add instructions to file 'update.manifest'"
 > $updatemanifestv1
 
 num_oldfiles=${#oldfiles[*]}
 remove_array=
--- a/tools/update-packaging/test/make_full_update.sh
+++ b/tools/update-packaging/test/make_full_update.sh
@@ -57,19 +57,16 @@ fi
 
 if [ ! -f "precomplete" ]; then
   notice "precomplete file is missing!"
   exit 1
 fi
 
 list_files files
 
-# Files that should be added on channel change
-ccfiles=$(find . -type f -name "channel-prefs.js" | sed 's/\.\/\(.*\)/\1/')
-
 popd
 
 notice ""
 notice "Adding file add instructions to file 'update.manifest'"
 > $updatemanifestv1
 
 num_files=${#files[*]}
 
@@ -90,29 +87,16 @@ done
 # 1 update manifest to the version 2 update manifest.
 > $updatemanifestv2
 notice ""
 notice "Adding type instruction to file 'updatev2.manifest'"
 notice "       type: complete"
 echo "type \"complete\"" >> $updatemanifestv2
 
 notice ""
-notice "Adding file add on channel change instructions to file 'updatev2.manifest'"
-for f in $ccfiles; do
-  notice "     add-cc: $f"
-  echo "add-cc \"$f\"" >> $updatemanifestv2
-  dir=$(dirname "$f")
-  mkdir -p "$workdir/$dir"
-  $BZIP2 -cz9 "$targetdir/$f" > "$workdir/$f"
-  copy_perm "$targetdir/$f" "$workdir/$f"
-
-  targetfiles="$targetfiles \"$f\""
-done
-
-notice ""
 notice "Concatenating file 'update.manifest' to file 'updatev2.manifest'"
 cat $updatemanifestv1 >> $updatemanifestv2
 
 # Append remove instructions for any dead files.
 notice ""
 notice "Adding file and directory remove instructions from file 'removed-files'"
 append_remove_instructions "$targetdir" "$updatemanifestv1" "$updatemanifestv2"