Bug 658094 - Partial updates for 5.0b1 on Mac fail. r=nrthomas
--- a/tools/update-packaging/common.sh
+++ b/tools/update-packaging/common.sh
@@ -103,17 +103,17 @@ append_remove_instructions() {
fixedprefix="$prefix"
if [ $prefix ]; then
if [ $(echo "$f" | grep -c '^\.\./') = 1 ]; then
if [ $(echo "$f" | grep -c '^\.\./\.\./') = 1 ]; then
f=$(echo $f | sed -e 's:^\.\.\/\.\.\/::')
fixedprefix=""
else
f=$(echo $f | sed -e 's:^\.\.\/::')
- fixedprefix=$(echo "$prefix" | sed -e 's:^[^\/]*\/::')
+ fixedprefix=$(echo "$prefix" | sed -e 's:[^\/]*\/$::')
fi
fi
fi
if [ $(echo "$f" | grep -c '\/$') = 1 ]; then
notice " rmdir: $fixedprefix$f"
echo "rmdir \"$fixedprefix$f\"" >> $filev2
elif [ $(echo "$f" | grep -c '\/\*$') = 1 ]; then
# Remove the *
--- a/tools/update-packaging/make_incremental_updates.py
+++ b/tools/update-packaging/make_incremental_updates.py
@@ -297,19 +297,25 @@ def process_explicit_remove_files(dir_pa
lines = []
for line in list_file:
lines.append(line.strip())
lines.sort(reverse=True)
for line in lines:
# Exclude any blank and comment lines.
if line and not line.startswith("#"):
+ if prefix != "":
+ if line.startswith("../"):
+ line = line.replace("../../", "")
+ line = line.replace("../", "Contents/")
+ else:
+ line = os.path.join(prefix,line)
# Python on windows uses \ for path separators and the update
# manifests expects / for path separators on all platforms.
- line=os.path.join(prefix,line).replace("\\", "/")
+ line = line.replace("\\", "/")
patch_info.append_remove_instruction(line)
def create_partial_patch(from_dir_path, to_dir_path, patch_filename, shas, patch_info, forced_updates):
""" Builds a partial patch by comparing the files in from_dir_path to thoes of to_dir_path"""
# Cannocolize the paths for safey
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