RelEng patch - Bug 660038 - Remove channel switching support. r=nthomas

This commit is contained in:
Robert Strong 2012-01-18 14:10:25 -08:00
parent e09f9f2450
commit 90e53d8fe2
4 changed files with 10 additions and 46 deletions

View File

@ -1,17 +1,18 @@
# 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()
@ -21,7 +22,8 @@ def get_build_entries(root_path):
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:
@ -40,7 +42,7 @@ def get_build_entries(root_path):
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.
"""
@ -54,10 +56,7 @@ def generate_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")

View File

@ -61,9 +61,6 @@ 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 ""
@ -93,19 +90,6 @@ 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

View File

@ -115,9 +115,6 @@ 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 ""

View File

@ -62,9 +62,6 @@ 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 ""
@ -94,19 +91,6 @@ 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