import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo

This commit is contained in:
Roy Tam 2018-01-19 03:59:58 +08:00
commit dcd9973243
150858 changed files with 23884658 additions and 0 deletions

View file

@ -0,0 +1,27 @@
#!/bin/bash
# Builds all the reference mars
if [ -f "ref.mar" ]; then
rm "ref.mar"
fi
if [ -f "ref-mac.mar" ]; then
rm "ref-mac.mar"
fi
../make_incremental_update.sh ref.mar `pwd`/from `pwd`/to
../make_incremental_update.sh ref-mac.mar `pwd`/from-mac `pwd`/to-mac
if [ -f "product-1.0.lang.platform.complete.mar" ]; then
rm "product-1.0.lang.platform.complete.mar"
fi
if [ -f "product-2.0.lang.platform.complete.mar" ]; then
rm "product-2.0.lang.platform.complete.mar"
fi
if [ -f "product-2.0.lang.mac.complete.mar" ]; then
rm "product-2.0.lang.mac.complete.mar"
fi
./make_full_update.sh product-1.0.lang.platform.complete.mar "`pwd`/from"
./make_full_update.sh product-2.0.lang.platform.complete.mar "`pwd`/to"
./make_full_update.sh product-1.0.lang.mac.complete.mar "`pwd`/from-mac"
./make_full_update.sh product-2.0.lang.mac.complete.mar "`pwd`/to-mac"

View file

@ -0,0 +1,14 @@
#!/bin/bash
# helper tool for testing. Cats the manifest out of a mar file
mar="$1"
workdir="/tmp/catmanifest"
rm -rf "$workdir"
mkdir -p "$workdir"
cp "$1" "$workdir"
cd "$workdir"
mar -x "$1"
mv updatev2.manifest updatev2.manifest.bz2
bzip2 -d updatev2.manifest.bz2
cat updatev2.manifest

View file

@ -0,0 +1,202 @@
#!/bin/bash
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Code shared by update packaging scripts.
# Author: Darin Fisher
#
# In here to use the local common.sh to allow the full mars to have unfiltered files
# -----------------------------------------------------------------------------
# By default just assume that these tools exist on our path
MAR=${MAR:-mar}
BZIP2=${BZIP2:-bzip2}
MBSDIFF=${MBSDIFF:-mbsdiff}
# -----------------------------------------------------------------------------
# Helper routines
notice() {
echo "$*" 1>&2
}
get_file_size() {
info=($(ls -ln "$1"))
echo ${info[4]}
}
copy_perm() {
reference="$1"
target="$2"
if [ -x "$reference" ]; then
chmod 0755 "$target"
else
chmod 0644 "$target"
fi
}
make_add_instruction() {
f="$1"
filev2="$2"
# The third param will be an empty string when a file add instruction is only
# needed in the version 2 manifest. This only happens when the file has an
# add-if-not instruction in the version 3 manifest. This is due to the
# precomplete file prior to the version 3 manifest having a remove instruction
# for this file so the file is removed before applying a complete update.
filev3="$3"
# Used to log to the console
if [ $4 ]; then
forced=" (forced)"
else
forced=
fi
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/\(.*distribution\/extensions\/[^\/]*\)\/.*/\1/')
notice " add-if \"$testdir\" \"$f\""
echo "add-if \"$testdir\" \"$f\"" >> $filev2
if [ ! $filev3 = "" ]; then
echo "add-if \"$testdir\" \"$f\"" >> $filev3
fi
else
notice " add \"$f\"$forced"
echo "add \"$f\"" >> $filev2
if [ ! $filev3 = "" ]; then
echo "add \"$f\"" >> $filev3
fi
fi
}
check_for_add_if_not_update() {
add_if_not_file_chk="$1"
if [ `basename $add_if_not_file_chk` = "channel-prefs.js" -o \
`basename $add_if_not_file_chk` = "update-settings.ini" ]; then
## "true" *giggle*
return 0;
fi
## 'false'... because this is bash. Oh yay!
return 1;
}
check_for_add_to_manifestv2() {
add_if_not_file_chk="$1"
if [ `basename $add_if_not_file_chk` = "update-settings.ini" ]; then
## "true" *giggle*
return 0;
fi
## 'false'... because this is bash. Oh yay!
return 1;
}
make_add_if_not_instruction() {
f="$1"
filev3="$2"
notice " add-if-not \"$f\" \"$f\""
echo "add-if-not \"$f\" \"$f\"" >> $filev3
}
make_patch_instruction() {
f="$1"
filev2="$2"
filev3="$3"
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/\(.*distribution\/extensions\/[^\/]*\)\/.*/\1/')
notice " patch-if \"$testdir\" \"$f.patch\" \"$f\""
echo "patch-if \"$testdir\" \"$f.patch\" \"$f\"" >> $filev2
echo "patch-if \"$testdir\" \"$f.patch\" \"$f\"" >> $filev3
else
notice " patch \"$f.patch\" \"$f\""
echo "patch \"$f.patch\" \"$f\"" >> $filev2
echo "patch \"$f.patch\" \"$f\"" >> $filev3
fi
}
append_remove_instructions() {
dir="$1"
filev2="$2"
filev3="$3"
if [ -f "$dir/removed-files" ]; then
listfile="$dir/removed-files"
elif [ -f "$dir/Contents/Resources/removed-files" ]; then
listfile="$dir/Contents/Resources/removed-files"
fi
if [ -n "$listfile" ]; then
# Map spaces to pipes so that we correctly handle filenames with spaces.
files=($(cat "$listfile" | tr " " "|" | sort -r))
num_files=${#files[*]}
for ((i=0; $i<$num_files; i=$i+1)); do
# Map pipes back to whitespace and remove carriage returns
f=$(echo ${files[$i]} | tr "|" " " | tr -d '\r')
# Trim whitespace
f=$(echo $f)
# Exclude blank lines.
if [ -n "$f" ]; then
# Exclude comments
if [ ! $(echo "$f" | grep -c '^#') = 1 ]; then
if [ $(echo "$f" | grep -c '\/$') = 1 ]; then
notice " rmdir \"$f\""
echo "rmdir \"$f\"" >> $filev2
echo "rmdir \"$f\"" >> $filev3
elif [ $(echo "$f" | grep -c '\/\*$') = 1 ]; then
# Remove the *
f=$(echo "$f" | sed -e 's:\*$::')
notice " rmrfdir \"$f\""
echo "rmrfdir \"$f\"" >> $filev2
echo "rmrfdir \"$f\"" >> $filev3
else
notice " remove \"$f\""
echo "remove \"$f\"" >> $filev2
echo "remove \"$f\"" >> $filev3
fi
fi
fi
done
fi
}
# List all files in the current directory, stripping leading "./"
# Pass a variable name and it will be filled as an array.
list_files() {
count=0
# Removed the exclusion cases here to allow for generation of testing mars
find . -type f \
| sed 's/\.\/\(.*\)/\1/' \
| sort -r > "$workdir/temp-filelist"
while read file; do
eval "${1}[$count]=\"$file\""
(( count++ ))
done < "$workdir/temp-filelist"
rm "$workdir/temp-filelist"
}
# List all directories in the current directory, stripping leading "./"
list_dirs() {
count=0
find . -type d \
! -name "." \
! -name ".." \
| sed 's/\.\/\(.*\)/\1/' \
| sort -r > "$workdir/temp-dirlist"
while read dir; do
eval "${1}[$count]=\"$dir\""
(( count++ ))
done < "$workdir/temp-dirlist"
rm "$workdir/temp-dirlist"
}

View file

@ -0,0 +1,51 @@
#!/bin/bash
# Compares two mars
marA="$1"
marB="$2"
testDir="$3"
workdir="/tmp/diffmar/$testDir"
fromdir="$workdir/0"
todir="$workdir/1"
# On Windows, creation time can be off by a second or more between the files in
# the fromdir and todir due to them being extracted synchronously so use
# time-style and exclude seconds from the creation time.
lsargs="-algR"
unamestr=`uname`
if [ ! "$unamestr" = 'Darwin' ]; then
unamestr=`uname -o`
if [ "$unamestr" = 'Msys' -o "$unamestr" = "Cygwin" ]; then
lsargs="-algR --time-style=+%Y-%m-%d-%H:%M"
fi
fi
rm -rf "$workdir"
mkdir -p "$fromdir"
mkdir -p "$todir"
cp "$1" "$fromdir"
cp "$2" "$todir"
cd "$fromdir"
mar -x "$1"
rm "$1"
mv updatev2.manifest updatev2.manifest.bz2
bzip2 -d updatev2.manifest.bz2
mv updatev3.manifest updatev3.manifest.bz2
bzip2 -d updatev3.manifest.bz2
ls $lsargs > files.txt
cd "$todir"
mar -x "$2"
rm "$2"
mv updatev2.manifest updatev2.manifest.bz2
bzip2 -d updatev2.manifest.bz2
mv updatev3.manifest updatev3.manifest.bz2
bzip2 -d updatev3.manifest.bz2
ls $lsargs > files.txt
echo "diffing $fromdir and $todir"
echo "on linux shell sort and python sort return different results"
echo "which can cause differences in the manifest files"
diff -ru "$fromdir" "$todir"

View file

@ -0,0 +1 @@
file is same

View file

@ -0,0 +1 @@
removed

View file

@ -0,0 +1 @@
from file shouldn't go in update

View file

@ -0,0 +1 @@
This from file should be ignored

View file

@ -0,0 +1 @@
removed

View file

@ -0,0 +1 @@
file is same

View file

@ -0,0 +1 @@
from file shouldn't go in update

View file

@ -0,0 +1,5 @@
[App]
Vendor=Mozilla
Name=MarTest
Version=1
BuildID=20120101010101

View file

@ -0,0 +1,26 @@
remove "Contents/MacOS/{foodir/update.manifest"
remove "Contents/MacOS/{foodir/same.txt"
remove "Contents/MacOS/{foodir/same.bin"
remove "Contents/MacOS/{foodir/removed.txt"
remove "Contents/MacOS/{foodir/readme.txt"
remove "Contents/MacOS/{foodir/force.txt"
remove "Contents/MacOS/{foodir/diff-patch-larger-than-file.txt"
remove "Contents/MacOS/update.manifest"
remove "Contents/MacOS/searchplugins/diff/diff-patch-larger-than-file.txt"
remove "Contents/MacOS/same.txt"
remove "Contents/MacOS/same.bin"
remove "Contents/MacOS/removed.txt"
remove "Contents/MacOS/readme.txt"
remove "Contents/MacOS/force.txt"
remove "Contents/MacOS/extensions/diff/diff-patch-larger-than-file.txt"
remove "Contents/MacOS/diff-patch-larger-than-file.txt"
remove "Contents/MacOS/application.ini"
remove "Contents/Resources/precomplete"
rmdir "Contents/MacOS/{foodir/"
rmdir "Contents/MacOS/searchplugins/diff/"
rmdir "Contents/MacOS/searchplugins/"
rmdir "Contents/MacOS/extensions/diff/"
rmdir "Contents/MacOS/extensions/"
rmdir "Contents/MacOS/"
rmdir "Contents/Resources/"
rmdir "Contents/"

View file

@ -0,0 +1,2 @@
This from file should be ignored

View file

@ -0,0 +1,8 @@
Contents/Resources/removed1.txt
Contents/MacOS/removed2.bin
Contents/MacOS/recursivedir/meh/*
Contents/Resources/dir/
Contents/MacOS/this file has spaces
Contents/MacOS/extra-spaces

View file

@ -0,0 +1 @@
removed

View file

@ -0,0 +1 @@
file is same

View file

@ -0,0 +1 @@
add-if-not from complete file

View file

@ -0,0 +1 @@
add-if-not from complete file

View file

@ -0,0 +1 @@
file is same

View file

@ -0,0 +1,5 @@
[App]
Vendor=Mozilla
Name=MarTest
Version=1
BuildID=20120101010101

View file

@ -0,0 +1 @@
from file

View file

@ -0,0 +1 @@
file is same

View file

@ -0,0 +1,23 @@
remove "{foodir/update.manifest"
remove "{foodir/same.txt"
remove "{foodir/same.bin"
remove "{foodir/removed.txt"
remove "{foodir/readme.txt"
remove "{foodir/force.txt"
remove "{foodir/diff-patch-larger-than-file.txt"
remove "update.manifest"
remove "searchplugins/diff/diff-patch-larger-than-file.txt"
remove "same.txt"
remove "same.bin"
remove "removed.txt"
remove "readme.txt"
remove "precomplete"
remove "force.txt"
remove "extensions/diff/diff-patch-larger-than-file.txt"
remove "diff-patch-larger-than-file.txt"
remove "application.ini"
rmdir "{foodir/"
rmdir "searchplugins/diff/"
rmdir "searchplugins/"
rmdir "extensions/diff/"
rmdir "extensions/"

View file

@ -0,0 +1,2 @@
This from file should be ignored

View file

@ -0,0 +1,8 @@
removed1.txt
removed2.bin
recursivedir/meh/*
dir/
this file has spaces
extra-spaces

View file

@ -0,0 +1 @@
removed

Binary file not shown.

View file

@ -0,0 +1 @@
file is same

View file

@ -0,0 +1 @@
add-if-not from complete file

View file

@ -0,0 +1 @@
from file shouldn't go in update

View file

@ -0,0 +1 @@
add-if-not from complete file

View file

@ -0,0 +1 @@
from file

View file

@ -0,0 +1 @@
file is same

View file

@ -0,0 +1 @@
This from file should be ignored

View file

@ -0,0 +1 @@
removed

Binary file not shown.

View file

@ -0,0 +1 @@
file is same

View file

@ -0,0 +1 @@
from file shouldn't go in update

View file

@ -0,0 +1,119 @@
#!/bin/bash
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# This tool generates full update packages for the update system.
# Author: Darin Fisher
#
# In here to use the local common.sh to allow the full mars to have unfiltered files
. $(dirname "$0")/common.sh
# -----------------------------------------------------------------------------
print_usage() {
notice "Usage: $(basename $0) [OPTIONS] ARCHIVE DIRECTORY"
}
if [ $# = 0 ]; then
print_usage
exit 1
fi
if [ $1 = -h ]; then
print_usage
notice ""
notice "The contents of DIRECTORY will be stored in ARCHIVE."
notice ""
notice "Options:"
notice " -h show this help text"
notice ""
exit 1
fi
# -----------------------------------------------------------------------------
archive="$1"
targetdir="$2"
# Prevent the workdir from being inside the targetdir so it isn't included in
# the update mar.
if [ $(echo "$targetdir" | grep -c '\/$') = 1 ]; then
# Remove the /
targetdir=$(echo "$targetdir" | sed -e 's:\/$::')
fi
workdir="$targetdir.work"
updatemanifestv2="$workdir/updatev2.manifest"
updatemanifestv3="$workdir/updatev3.manifest"
targetfiles="updatev2.manifest updatev3.manifest"
mkdir -p "$workdir"
# Generate a list of all files in the target directory.
pushd "$targetdir"
if test $? -ne 0 ; then
exit 1
fi
if [ ! -f "precomplete" ]; then
if [ ! -f "Contents/Resources/precomplete" ]; then
notice "precomplete file is missing!"
exit 1
fi
fi
list_files files
popd
# Add the type of update to the beginning of the update manifests.
> $updatemanifestv2
> $updatemanifestv3
notice ""
notice "Adding type instruction to update manifests"
notice " type complete"
echo "type \"complete\"" >> $updatemanifestv2
echo "type \"complete\"" >> $updatemanifestv3
notice ""
notice "Adding file add instructions to update manifests"
num_files=${#files[*]}
for ((i=0; $i<$num_files; i=$i+1)); do
f="${files[$i]}"
if check_for_add_if_not_update "$f"; then
make_add_if_not_instruction "$f" "$updatemanifestv3"
if check_for_add_to_manifestv2 "$f"; then
make_add_instruction "$f" "$updatemanifestv2" "" 1
fi
else
make_add_instruction "$f" "$updatemanifestv2" "$updatemanifestv3"
fi
dir=$(dirname "$f")
mkdir -p "$workdir/$dir"
$BZIP2 -cz9 "$targetdir/$f" > "$workdir/$f"
copy_perm "$targetdir/$f" "$workdir/$f"
targetfiles="$targetfiles \"$f\""
done
# Append remove instructions for any dead files.
notice ""
notice "Adding file and directory remove instructions from file 'removed-files'"
append_remove_instructions "$targetdir" "$updatemanifestv2" "$updatemanifestv3"
$BZIP2 -z9 "$updatemanifestv2" && mv -f "$updatemanifestv2.bz2" "$updatemanifestv2"
$BZIP2 -z9 "$updatemanifestv3" && mv -f "$updatemanifestv3.bz2" "$updatemanifestv3"
eval "$MAR -C \"$workdir\" -c output.mar $targetfiles"
mv -f "$workdir/output.mar" "$archive"
# cleanup
rm -fr "$workdir"
notice ""
notice "Finished"
notice ""

View file

@ -0,0 +1,12 @@
#!/bin/bash
echo "testing make_incremental_updates.py"
python ../make_incremental_updates.py -f testpatchfile.txt
echo ""
echo "diffing ref.mar and test.mar"
./diffmar.sh ref.mar test.mar test
echo ""
echo "diffing ref-mac.mar and test-mac.mar"
./diffmar.sh ref-mac.mar test-mac.mar test-mac

View file

@ -0,0 +1,2 @@
product-1.0.lang.platform.complete.mar,product-2.0.lang.platform.complete.mar,test.mar,""
product-1.0.lang.mac.complete.mar,product-2.0.lang.mac.complete.mar,test-mac.mar,""

View file

@ -0,0 +1 @@
this is a new file

View file

@ -0,0 +1 @@
added file

View file

@ -0,0 +1 @@
file is same

View file

@ -0,0 +1 @@
to file shouldn't go in update

View file

@ -0,0 +1 @@
added file

View file

@ -0,0 +1 @@
This to file should be ignored

View file

@ -0,0 +1 @@
file is same

View file

@ -0,0 +1 @@
to file shouldn't go in update

View file

@ -0,0 +1,5 @@
[App]
Vendor=Mozilla
Name=MarTest
Version=2
BuildID=20130101010101

View file

@ -0,0 +1,33 @@
remove "Contents/MacOS/{foodir/update.manifest"
remove "Contents/MacOS/{foodir/same.txt"
remove "Contents/MacOS/{foodir/same.bin"
remove "Contents/MacOS/{foodir/readme.txt"
remove "Contents/MacOS/{foodir/force.txt"
remove "Contents/MacOS/{foodir/diff-patch-larger-than-file.txt"
remove "Contents/MacOS/{foodir/added.txt"
remove "Contents/MacOS/update.manifest"
remove "Contents/MacOS/searchplugins/diff/diff-patch-larger-than-file.txt"
remove "Contents/MacOS/searchplugins/added/file.txt"
remove "Contents/MacOS/same.txt"
remove "Contents/MacOS/same.bin"
remove "Contents/MacOS/removed-files"
remove "Contents/MacOS/readme.txt"
remove "Contents/MacOS/force.txt"
remove "Contents/MacOS/extensions/diff/diff-patch-larger-than-file.txt"
remove "Contents/MacOS/extensions/added/file.txt"
remove "Contents/MacOS/diff-patch-larger-than-file.txt"
remove "Contents/MacOS/diff-patch-larger-than-file.bin"
remove "Contents/MacOS/application.ini"
remove "Contents/MacOS/added.txt"
remove "Contents/MacOS/addFeedPrefs.js"
remove "Contents/Resources/precomplete"
rmdir "Contents/MacOS/{foodir/"
rmdir "Contents/MacOS/searchplugins/diff/"
rmdir "Contents/MacOS/searchplugins/added/"
rmdir "Contents/MacOS/searchplugins/"
rmdir "Contents/MacOS/extensions/diff/"
rmdir "Contents/MacOS/extensions/added/"
rmdir "Contents/MacOS/extensions/"
rmdir "Contents/MacOS/"
rmdir "Contents/Resources/"
rmdir "Contents/"

View file

@ -0,0 +1 @@
This to file should be ignored

View file

@ -0,0 +1,14 @@
Contents/Resources/removed1.txt
Contents/MacOS/removed2.bin
Contents/MacOS/recursivedir/meh/*
Contents/MacOS/removed3-foo.txt
Contents/Resources/dir/
Contents/MacOS/this file has spaces
Contents/MacOS/notherdir/
Contents/Resources/extra-spaces
Contents/MacOS/lastFile

View file

@ -0,0 +1 @@
file is same

View file

@ -0,0 +1 @@
add-if-not from complete file

View file

@ -0,0 +1 @@
add-if-not from partial file

View file

@ -0,0 +1 @@
file is same

View file

@ -0,0 +1 @@
this is a new file

View file

@ -0,0 +1 @@
added file

View file

@ -0,0 +1,5 @@
[App]
Vendor=Mozilla
Name=MarTest
Version=2
BuildID=20130101010101

View file

@ -0,0 +1 @@
file to

View file

@ -0,0 +1 @@
extfile

View file

@ -0,0 +1 @@
extfile

View file

@ -0,0 +1 @@
file is same

View file

@ -0,0 +1,30 @@
remove "{foodir/update.manifest"
remove "{foodir/same.txt"
remove "{foodir/same.bin"
remove "{foodir/readme.txt"
remove "{foodir/force.txt"
remove "{foodir/diff-patch-larger-than-file.txt"
remove "{foodir/added.txt"
remove "update.manifest"
remove "searchplugins/diff/diff-patch-larger-than-file.txt"
remove "searchplugins/added/file.txt"
remove "same.txt"
remove "same.bin"
remove "removed-files"
remove "readme.txt"
remove "precomplete"
remove "force.txt"
remove "extensions/diff/diff-patch-larger-than-file.txt"
remove "extensions/added/file.txt"
remove "diff-patch-larger-than-file.txt"
remove "diff-patch-larger-than-file.bin"
remove "application.ini"
remove "added.txt"
remove "addFeedPrefs.js"
rmdir "{foodir/"
rmdir "searchplugins/diff/"
rmdir "searchplugins/added/"
rmdir "searchplugins/"
rmdir "extensions/diff/"
rmdir "extensions/added/"
rmdir "extensions/"

View file

@ -0,0 +1 @@
This to file should be ignored

View file

@ -0,0 +1,14 @@
removed1.txt
removed2.bin
recursivedir/meh/*
removed3-foo.txt
dir/
this file has spaces
notherdir/
extra-spaces
lastFile

Binary file not shown.

View file

@ -0,0 +1 @@
file is same

View file

@ -0,0 +1 @@
extfile

View file

@ -0,0 +1 @@
add-if-not from complete file

View file

@ -0,0 +1 @@
to file shouldn't go in update

View file

@ -0,0 +1 @@
added file

View file

@ -0,0 +1 @@
add-if-not from complete file

Some files were not shown because too many files have changed in this diff Show more