Browse Source

More build and packaging backports

Ian Neal 2 months ago
parent
commit
394e14ee4b

+ 36 - 0
comm-release/patches/1564611-70a1.patch

@@ -0,0 +1,36 @@
+# HG changeset patch
+# User Rob Lemley <rob@thunderbird.net>
+# Date 1562712264 14400
+# Node ID f29f4cb6a42e99421afbf05bf53b98144f3cd00c
+# Parent  d6f5d51f7cfd123eca779015c4d6b9d401e81077
+Bug 1564611 - Port bug 1458385: Repackaging Windows builds on Linux. r=darktrojan DONTBUILD
+
+Based on the changes in the referenced M-C bug.
+
+diff --git a/mail/confvars.sh b/mail/confvars.sh
+--- a/mail/confvars.sh
++++ b/mail/confvars.sh
+@@ -23,22 +23,17 @@ MOZ_APP_VERSION=$THUNDERBIRD_VERSION
+ MOZ_APP_VERSION_DISPLAY=$THUNDERBIRD_VERSION_DISPLAY
+ 
+ BROWSER_CHROME_URL=chrome://messenger/content/messengercompose/messengercompose.xul
+ 
+ MOZ_BRANDING_DIRECTORY=$commreltopsrcdir/mail/branding/thunderbird
+ MOZ_OFFICIAL_BRANDING_DIRECTORY=$commreltopsrcdir/mail/branding/thunderbird
+ 
+ MOZ_APP_ID={3550f703-e582-4d05-9a08-453d09bdfdc6}
+-# This should usually be the same as the value MAR_CHANNEL_ID.
+-# If more than one ID is needed, then you should use a comma separated list
+-# of values.
+-ACCEPTED_MAR_CHANNEL_IDS=thunderbird-comm-release
+-# The MAR_CHANNEL_ID must not contain the following 3 characters: ",\t "
+-MAR_CHANNEL_ID=thunderbird-comm-release
++
+ MOZ_PROFILE_MIGRATOR=1
+ MOZ_BINARY_EXTENSIONS=1
+ MOZ_SEPARATE_MANIFEST_FOR_THEME_OVERRIDES=1
+ 
+ # Enable building ./signmar and running libmar signature tests
+ MOZ_ENABLE_SIGNMAR=1
+ 
+ MOZ_DEVTOOLS=all

+ 32 - 0
comm-release/patches/1913633-mar-channel-ids-25320.patch

@@ -0,0 +1,32 @@
+# HG changeset patch
+# User Ian Neal <iann_cvs@blueyonder.co.uk>
+# Date 1723992023 -3600
+# Parent  4a1cabe28b81d08f86e743177ba276dfacafa5dc
+Bug 1913633 - Port bug 1458385 - Update SeaMonkey's confvars.sh. r=frg a=frg
+
+diff --git a/suite/confvars.sh b/suite/confvars.sh
+--- a/suite/confvars.sh
++++ b/suite/confvars.sh
+@@ -13,22 +13,16 @@ MOZ_APP_VERSION_DISPLAY=$SEAMONKEY_VERSI
+ MOZ_PKG_VERSION=$SEAMONKEY_VERSION_PACKAGE
+ 
+ BROWSER_CHROME_URL=chrome://navigator/content/navigator.xul
+ 
+ MOZ_BRANDING_DIRECTORY=comm/suite/branding/seamonkey
+ MOZ_OFFICIAL_BRANDING_DIRECTORY=comm/suite/branding/seamonkey
+ 
+ MOZ_UPDATER=1
+-# This should usually be the same as the value MAR_CHANNEL_ID.
+-# If more than one ID is needed, then you should use a comma separated list
+-# of values.
+-ACCEPTED_MAR_CHANNEL_IDS=seamonkey-comm-central
+-# The MAR_CHANNEL_ID must not contain the following 3 characters: ",\t "
+-MAR_CHANNEL_ID=seamonkey-comm-central
+ 
+ MOZ_APP_ID={92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}
+ MOZ_PROFILE_MIGRATOR=1
+ 
+ # Include the DevTools client, not just the server (which is the default)
+ MOZ_DEVTOOLS=all
+ 
+ NSS_EXTRA_SYMBOLS_FILE=../comm/mailnews/nss-extra.symbols

+ 2 - 0
comm-release/patches/series

@@ -2186,3 +2186,5 @@ TOP-1906540-mozdevice-removal-comm-25320.patch
 1912354-domiselect-25320.patch
 1912354-domiselect-25320.patch
 1488138-64a1.patch
 1488138-64a1.patch
 1913579-removed-files-25320.patch
 1913579-removed-files-25320.patch
+1564611-70a1.patch
+1913633-mar-channel-ids-25320.patch

+ 42 - 0
mozilla-release/patches/1389420-57a1.patch

@@ -0,0 +1,42 @@
+# HG changeset patch
+# User Johan Lorenzo <jlorenzo@mozilla.com>
+# Date 1505381872 -7200
+# Node ID e10c49f7258a9cf281af774e9cac7d876a68c5f1
+# Parent  bb6eec341e5cfdfdc122262edff682a9a50039ae
+Bug 1389420 - [mozilla-release leftovers] Rename android-api-15 to android-api-16 once 56 reaches release r=sfraser
+
+MozReview-Commit-ID: J1sgnaH9j0p
+
+diff --git a/testing/mozharness/configs/merge_day/beta_to_release.py b/testing/mozharness/configs/merge_day/beta_to_release.py
+--- a/testing/mozharness/configs/merge_day/beta_to_release.py
++++ b/testing/mozharness/configs/merge_day/beta_to_release.py
+@@ -10,27 +10,25 @@ config = {
+             "dst": "browser/config/version_display.txt",
+         },
+     ],
+     "replacements": [
+         # File, from, to
+         ("{}{}".format(d, f),
+         "ac_add_options --with-branding=mobile/android/branding/beta",
+         "ac_add_options --with-branding=mobile/android/branding/official")
+-        # TODO Bug 1389420: Rename api-15 into api-16 after Firefox 57 made Beta
+-        for d in ["mobile/android/config/mozconfigs/android-api-15/",
++        for d in ["mobile/android/config/mozconfigs/android-api-16/",
+                   "mobile/android/config/mozconfigs/android-x86/",
+                   "mobile/android/config/mozconfigs/android-aarch64/"]
+         for f in ["debug", "nightly", "l10n-nightly"]
+     ] + [
+         # File, from, to
+         (f, "ac_add_options --with-l10n-base=../../mozilla-beta",
+         "ac_add_options --with-l10n-base=../../mozilla-release")
+-        # TODO Bug 1389420: Rename api-15 into api-16 after Firefox 57 made Beta
+-        for f in ["mobile/android/config/mozconfigs/android-api-15/l10n-nightly",
++        for f in ["mobile/android/config/mozconfigs/android-api-16/l10n-nightly",
+                   "mobile/android/config/mozconfigs/android-x86/l10n-nightly",
+                   "mobile/android/config/mozconfigs/android-aarch64/l10n-nightly"]
+     ] + [
+         # File, from, to
+         ("browser/confvars.sh",
+          "ACCEPTED_MAR_CHANNEL_IDS=firefox-mozilla-beta,firefox-mozilla-release",
+          "ACCEPTED_MAR_CHANNEL_IDS=firefox-mozilla-release"),
+         ("browser/confvars.sh",

+ 527 - 0
mozilla-release/patches/1392914-79a1.patch

@@ -0,0 +1,527 @@
+# HG changeset patch
+# User Simon Fraser <sfraser@mozilla.com>
+# Date 1592466141 0
+# Node ID 3275aa91dcf96d3ee791bc8948119eee0a713566
+# Parent  5fa05105f8f8732f57da6ce941d79b7408bcbc9f
+Bug 1392914 Remove updatev2.manifest r=mhowell
+
+I've left the mention of updatev2.manifest in list_files and list_dirs for now, similar to how v1 has been left.
+
+Differential Revision: https://phabricator.services.mozilla.com/D80011
+
+diff --git a/tools/update-packaging/common.sh b/tools/update-packaging/common.sh
+--- a/tools/update-packaging/common.sh
++++ b/tools/update-packaging/common.sh
+@@ -62,105 +62,78 @@ copy_perm() {
+     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"
++  filev3="$2"
+ 
+   # 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/')
+     verbose_notice "     add-if \"$testdir\" \"$f\""
+-    echo "add-if \"$testdir\" \"$f\"" >> "$filev2"
+-    if [ ! $filev3 = "" ]; then
+-      echo "add-if \"$testdir\" \"$f\"" >> "$filev3"
+-    fi
++    echo "add-if \"$testdir\" \"$f\"" >> "$filev3"
+   else
+     verbose_notice "        add \"$f\"$forced"
+-    echo "add \"$f\"" >> "$filev2"
+-    if [ ! "$filev3" = "" ]; then
+-      echo "add \"$f\"" >> "$filev3"
+-    fi
++    echo "add \"$f\"" >> "$filev3"
+   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"
+ 
+   verbose_notice " add-if-not \"$f\" \"$f\""
+   echo "add-if-not \"$f\" \"$f\"" >> "$filev3"
+ }
+ 
+ make_patch_instruction() {
+   f="$1"
+-  filev2="$2"
+-  filev3="$3"
++  filev3="$2"
+ 
+   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/')
+     verbose_notice "   patch-if \"$testdir\" \"$f.patch\" \"$f\""
+-    echo "patch-if \"$testdir\" \"$f.patch\" \"$f\"" >> "$filev2"
+     echo "patch-if \"$testdir\" \"$f.patch\" \"$f\"" >> "$filev3"
+   else
+     verbose_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"
++  filev3="$2"
+ 
+   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.
+@@ -172,27 +145,24 @@ append_remove_instructions() {
+       # 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
+             verbose_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:\*$::')
+             verbose_notice "    rmrfdir \"$f\""
+-            echo "rmrfdir \"$f\"" >> "$filev2"
+             echo "rmrfdir \"$f\"" >> "$filev3"
+           else
+             verbose_notice "     remove \"$f\""
+-            echo "remove \"$f\"" >> "$filev2"
+             echo "remove \"$f\"" >> "$filev3"
+           fi
+         fi
+       fi
+     done
+   fi
+ }
+ 
+diff --git a/tools/update-packaging/make_full_update.sh b/tools/update-packaging/make_full_update.sh
+--- a/tools/update-packaging/make_full_update.sh
++++ b/tools/update-packaging/make_full_update.sh
+@@ -30,35 +30,35 @@ if [ $1 = -h ]; then
+   notice "  -h  show this help text"
+   notice "  -q  be less verbose"
+   notice ""
+   exit 1
+ fi
+ 
+ if [ $1 = -q ]; then
+   QUIET=1
++  export QUIET
+   shift
+ fi
+ 
+ # -----------------------------------------------------------------------------
+ 
+ mar_command="$MAR -V ${MOZ_PRODUCT_VERSION:?} -H ${MAR_CHANNEL_ID:?}"
+ 
+ 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"
++targetfiles="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
+@@ -70,54 +70,48 @@ if [ ! -f "precomplete" ]; then
+   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"
++    make_add_instruction "$f" "$updatemanifestv3"
+   fi
+ 
+   dir=$(dirname "$f")
+   mkdir -p "$workdir/$dir"
+   $XZ $XZ_OPT --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force --stdout "$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"
++append_remove_instructions "$targetdir" "$updatemanifestv3"
+ 
+-$XZ $XZ_OPT --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force "$updatemanifestv2" && mv -f "$updatemanifestv2.xz" "$updatemanifestv2"
+ $XZ $XZ_OPT --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force "$updatemanifestv3" && mv -f "$updatemanifestv3.xz" "$updatemanifestv3"
+ 
+ mar_command="$mar_command -C \"$workdir\" -c output.mar"
+ eval "$mar_command $targetfiles"
+ mv -f "$workdir/output.mar" "$archive"
+ 
+ # cleanup
+ rm -fr "$workdir"
+diff --git a/tools/update-packaging/make_incremental_update.sh b/tools/update-packaging/make_incremental_update.sh
+--- a/tools/update-packaging/make_incremental_update.sh
++++ b/tools/update-packaging/make_incremental_update.sh
+@@ -110,19 +110,18 @@ olddir="$2"
+ newdir="$3"
+ # Prevent the workdir from being inside the targetdir so it isn't included in
+ # the update mar.
+ if [ $(echo "$newdir" | grep -c '\/$') = 1 ]; then
+   # Remove the /
+   newdir=$(echo "$newdir" | sed -e 's:\/$::')
+ fi
+ workdir="$(mktemp -d)"
+-updatemanifestv2="$workdir/updatev2.manifest"
+ updatemanifestv3="$workdir/updatev3.manifest"
+-archivefiles="updatev2.manifest updatev3.manifest"
++archivefiles="updatev3.manifest"
+ 
+ mkdir -p "$workdir"
+ 
+ # Generate a list of all files in the target directory.
+ pushd "$olddir"
+ if test $? -ne 0 ; then
+   exit 1
+ fi
+@@ -147,20 +146,18 @@ fi
+ list_dirs newdirs
+ list_files newfiles
+ 
+ popd
+ 
+ # Add the type of update to the beginning of the update manifests.
+ notice ""
+ notice "Adding type instruction to update manifests"
+-> $updatemanifestv2
+ > $updatemanifestv3
+ notice "       type partial"
+-echo "type \"partial\"" >> $updatemanifestv2
+ echo "type \"partial\"" >> $updatemanifestv3
+ 
+ notice ""
+ notice "Adding file patch and add instructions to update manifests"
+ 
+ num_oldfiles=${#oldfiles[*]}
+ remove_array=
+ num_removes=0
+@@ -181,17 +178,17 @@ for ((i=0; $i<$num_oldfiles; i=$i+1)); d
+       continue 1
+     fi
+ 
+     if check_for_forced_update "$requested_forced_updates" "$f"; then
+       # The full workdir may not exist yet, so create it if necessary.
+       mkdir -p `dirname "$workdir/$f"`
+       $XZ $XZ_OPT --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force --stdout "$newdir/$f" > "$workdir/$f"
+       copy_perm "$newdir/$f" "$workdir/$f"
+-      make_add_instruction "$f" "$updatemanifestv2" "$updatemanifestv3" 1
++      make_add_instruction "$f" "$updatemanifestv3" 1
+       archivefiles="$archivefiles \"$f\""
+       continue 1
+     fi
+ 
+     if ! diff "$olddir/$f" "$newdir/$f" > /dev/null; then
+       # Compute both the compressed binary diff and the compressed file, and
+       # compare the sizes.  Then choose the smaller of the two to package.
+       dir=$(dirname "$workdir/$f")
+@@ -226,22 +223,22 @@ for ((i=0; $i<$num_oldfiles; i=$i+1)); d
+       fi
+       $XZ $XZ_OPT --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force --stdout "$newdir/$f" > "$workdir/$f"
+       copy_perm "$newdir/$f" "$workdir/$f"
+       patchfile="$workdir/$f.patch.xz"
+       patchsize=$(get_file_size "$patchfile")
+       fullsize=$(get_file_size "$workdir/$f")
+ 
+       if [ $patchsize -lt $fullsize ]; then
+-        make_patch_instruction "$f" "$updatemanifestv2" "$updatemanifestv3"
++        make_patch_instruction "$f" "$updatemanifestv3"
+         mv -f "$patchfile" "$workdir/$f.patch"
+         rm -f "$workdir/$f"
+         archivefiles="$archivefiles \"$f.patch\""
+       else
+-        make_add_instruction "$f" "$updatemanifestv2" "$updatemanifestv3"
++        make_add_instruction "$f" "$updatemanifestv3"
+         rm -f "$patchfile"
+         archivefiles="$archivefiles \"$f\""
+       fi
+     fi
+   else
+     # remove instructions are added after add / patch instructions for
+     # consistency with make_incremental_updates.py
+     remove_array[$num_removes]=$f
+@@ -268,52 +265,49 @@ for ((i=0; $i<$num_newfiles; i=$i+1)); d
+   mkdir -p "$dir"
+ 
+   $XZ $XZ_OPT --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force --stdout "$newdir/$f" > "$workdir/$f"
+   copy_perm "$newdir/$f" "$workdir/$f"
+ 
+   if check_for_add_if_not_update "$f"; then
+     make_add_if_not_instruction "$f" "$updatemanifestv3"
+   else
+-    make_add_instruction "$f" "$updatemanifestv2" "$updatemanifestv3"
++    make_add_instruction "$f" "$updatemanifestv3"
+   fi
+ 
+ 
+   archivefiles="$archivefiles \"$f\""
+ done
+ 
+ notice ""
+ notice "Adding file remove instructions to update manifests"
+ for ((i=0; $i<$num_removes; i=$i+1)); do
+   f="${remove_array[$i]}"
+   verbose_notice "     remove \"$f\""
+-  echo "remove \"$f\"" >> $updatemanifestv2
+   echo "remove \"$f\"" >> $updatemanifestv3
+ done
+ 
+ # Add remove instructions for any dead files.
+ notice ""
+ notice "Adding file and directory remove instructions from file 'removed-files'"
+-append_remove_instructions "$newdir" "$updatemanifestv2" "$updatemanifestv3"
++append_remove_instructions "$newdir" "$updatemanifestv3"
+ 
+ notice ""
+ notice "Adding directory remove instructions for directories that no longer exist"
+ num_olddirs=${#olddirs[*]}
+ 
+ for ((i=0; $i<$num_olddirs; i=$i+1)); do
+   f="${olddirs[$i]}"
+   # If this dir doesn't exist in the new directory remove it.
+   if [ ! -d "$newdir/$f" ]; then
+     verbose_notice "      rmdir $f/"
+-    echo "rmdir \"$f/\"" >> $updatemanifestv2
+     echo "rmdir \"$f/\"" >> $updatemanifestv3
+   fi
+ done
+ 
+-$XZ $XZ_OPT --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force "$updatemanifestv2" && mv -f "$updatemanifestv2.xz" "$updatemanifestv2"
+ $XZ $XZ_OPT --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force "$updatemanifestv3" && mv -f "$updatemanifestv3.xz" "$updatemanifestv3"
+ 
+ mar_command="$mar_command -C \"$workdir\" -c output.mar"
+ eval "$mar_command $archivefiles"
+ mv -f "$workdir/output.mar" "$archive"
+ 
+ # cleanup
+ rm -fr "$workdir"
+diff --git a/tools/update-packaging/test/catmanifest.sh b/tools/update-packaging/test/catmanifest.sh
+deleted file mode 100755
+--- a/tools/update-packaging/test/catmanifest.sh
++++ /dev/null
+@@ -1,14 +0,0 @@
+-#!/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.xz
+-xz -d updatev2.manifest.xz
+-cat updatev2.manifest
+diff --git a/tools/update-packaging/test/diffmar.sh b/tools/update-packaging/test/diffmar.sh
+--- a/tools/update-packaging/test/diffmar.sh
++++ b/tools/update-packaging/test/diffmar.sh
+@@ -25,27 +25,24 @@ mkdir -p "$fromdir"
+ mkdir -p "$todir"
+ 
+ cp "$1" "$fromdir"
+ cp "$2" "$todir"
+ 
+ cd "$fromdir"
+ mar -x "$1"
+ rm "$1"
+-mv updatev2.manifest updatev2.manifest.xz
+-xz -d updatev2.manifest.xz
++rm -f updatev2.manifest  # Older files may contain this
+ mv updatev3.manifest updatev3.manifest.xz
+ xz -d updatev3.manifest.xz
+ ls $lsargs > files.txt
+ 
+ cd "$todir"
+ mar -x "$2"
+ rm "$2"
+-mv updatev2.manifest updatev2.manifest.xz
+-xz -d updatev2.manifest.xz
+ mv updatev3.manifest updatev3.manifest.xz
+ xz -d updatev3.manifest.xz
+ 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"
+diff --git a/tools/update-packaging/test/make_full_update.sh b/tools/update-packaging/test/make_full_update.sh
+--- a/tools/update-packaging/test/make_full_update.sh
++++ b/tools/update-packaging/test/make_full_update.sh
+@@ -39,19 +39,18 @@ 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"
++targetfiles="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
+@@ -63,54 +62,48 @@ if [ ! -f "precomplete" ]; then
+   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"
++    make_add_instruction "$f" "$updatemanifestv3"
+   fi
+ 
+   dir=$(dirname "$f")
+   mkdir -p "$workdir/$dir"
+   $XZ $XZ_OPT --compress --x86 --lzma2 --format=xz --check=crc64 --force --stdout "$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"
++append_remove_instructions "$targetdir" "$updatemanifestv3"
+ 
+-$XZ $XZ_OPT --compress --x86 --lzma2 --format=xz --check=crc64 --force "$updatemanifestv2" && mv -f "$updatemanifestv2.xz" "$updatemanifestv2"
+ $XZ $XZ_OPT --compress --x86 --lzma2 --format=xz --check=crc64 --force "$updatemanifestv3" && mv -f "$updatemanifestv3.xz" "$updatemanifestv3"
+ 
+ eval "$MAR -C \"$workdir\" -c output.mar $targetfiles"
+ mv -f "$workdir/output.mar" "$archive"
+ 
+ # cleanup
+ rm -fr "$workdir"
+ 

+ 67 - 0
mozilla-release/patches/1403084-58a1.patch

@@ -0,0 +1,67 @@
+# HG changeset patch
+# User Justin Wood <Callek@gmail.com>
+# Date 1506428652 14400
+# Node ID bd4014f5f6bab71c87d0ba661ac016ce1ccc0eda
+# Parent  c700e598c120321f9cc56e25df528483b8f5ea28
+Bug 1403084 - Make beta point at l10n-central for android. r=mtabara
+
+This fixes Single Locale Repacks for Fennec 57.0 betas.
+
+This broke because our merge scripts rewrote l10n-central to mozilla-beta expecting the l10n repo to be called 'mozilla-beta', which is no longer true with cross-channel l10n. When we patched the configs we didn't see a 'mozilla-beta' entry here, butmissed that the merge-day scripts change it on us.
+
+MozReview-Commit-ID: F7BJzpZg0Xj
+
+diff --git a/testing/mozharness/configs/merge_day/beta_to_release.py b/testing/mozharness/configs/merge_day/beta_to_release.py
+--- a/testing/mozharness/configs/merge_day/beta_to_release.py
++++ b/testing/mozharness/configs/merge_day/beta_to_release.py
+@@ -16,23 +16,16 @@ config = {
+         "ac_add_options --with-branding=mobile/android/branding/beta",
+         "ac_add_options --with-branding=mobile/android/branding/official")
+         for d in ["mobile/android/config/mozconfigs/android-api-16/",
+                   "mobile/android/config/mozconfigs/android-x86/",
+                   "mobile/android/config/mozconfigs/android-aarch64/"]
+         for f in ["debug", "nightly", "l10n-nightly"]
+     ] + [
+         # File, from, to
+-        (f, "ac_add_options --with-l10n-base=../../mozilla-beta",
+-        "ac_add_options --with-l10n-base=../../mozilla-release")
+-        for f in ["mobile/android/config/mozconfigs/android-api-16/l10n-nightly",
+-                  "mobile/android/config/mozconfigs/android-x86/l10n-nightly",
+-                  "mobile/android/config/mozconfigs/android-aarch64/l10n-nightly"]
+-    ] + [
+-        # File, from, to
+         ("browser/confvars.sh",
+          "ACCEPTED_MAR_CHANNEL_IDS=firefox-mozilla-beta,firefox-mozilla-release",
+          "ACCEPTED_MAR_CHANNEL_IDS=firefox-mozilla-release"),
+         ("browser/confvars.sh",
+          "MAR_CHANNEL_ID=firefox-mozilla-beta",
+          "MAR_CHANNEL_ID=firefox-mozilla-release"),
+     ],
+ 
+diff --git a/testing/mozharness/configs/merge_day/central_to_beta.py b/testing/mozharness/configs/merge_day/central_to_beta.py
+--- a/testing/mozharness/configs/merge_day/central_to_beta.py
++++ b/testing/mozharness/configs/merge_day/central_to_beta.py
+@@ -24,23 +24,16 @@ config = {
+         "ac_add_options --enable-official-branding")
+         for f in ["browser/config/mozconfigs/linux32/l10n-mozconfig",
+                   "browser/config/mozconfigs/linux64/l10n-mozconfig",
+                   "browser/config/mozconfigs/win32/l10n-mozconfig",
+                   "browser/config/mozconfigs/win64/l10n-mozconfig",
+                   "browser/config/mozconfigs/macosx64/l10n-mozconfig"]
+     ] + [
+         # File, from, to
+-        (f, "ac_add_options --with-l10n-base=../../l10n-central",
+-        "ac_add_options --with-l10n-base=../../mozilla-beta")
+-        for f in ["mobile/android/config/mozconfigs/android-api-16/l10n-nightly",
+-                  "mobile/android/config/mozconfigs/android-x86/l10n-nightly",
+-                  "mobile/android/config/mozconfigs/android-aarch64/l10n-nightly"]
+-    ] + [
+-        # File, from, to
+         (f, "ac_add_options --enable-profiling", "") for f in
+         ["mobile/android/config/mozconfigs/android-api-16/nightly",
+          "mobile/android/config/mozconfigs/android-x86/nightly",
+          "mobile/android/config/mozconfigs/android-aarch64/nightly",
+          "browser/config/mozconfigs/linux32/nightly",
+          "browser/config/mozconfigs/linux64/nightly",
+          "browser/config/mozconfigs/macosx64/nightly",
+          "browser/config/mozconfigs/win32/nightly",

+ 29 - 0
mozilla-release/patches/1412962-59a1.patch

@@ -0,0 +1,29 @@
+# HG changeset patch
+# User Jordan Lund <jlund@mozilla.com>
+# Date 1515675690 18000
+# Node ID c4e4613dbe32bb218957a140e5d0bd4fe7d1e98c
+# Parent  f823d373b4c2b750b21b913eb1e0abda8c88265f
+Bug 1412962 - Remove munging of l10n-nightly configs for beta=>release migration. r=sfraser a=release for CLOSED TREE on central DONTBUILD
+
+diff --git a/testing/mozharness/configs/merge_day/beta_to_release.py b/testing/mozharness/configs/merge_day/beta_to_release.py
+--- a/testing/mozharness/configs/merge_day/beta_to_release.py
++++ b/testing/mozharness/configs/merge_day/beta_to_release.py
+@@ -13,17 +13,17 @@ config = {
+     "replacements": [
+         # File, from, to
+         ("{}{}".format(d, f),
+         "ac_add_options --with-branding=mobile/android/branding/beta",
+         "ac_add_options --with-branding=mobile/android/branding/official")
+         for d in ["mobile/android/config/mozconfigs/android-api-16/",
+                   "mobile/android/config/mozconfigs/android-x86/",
+                   "mobile/android/config/mozconfigs/android-aarch64/"]
+-        for f in ["debug", "nightly", "l10n-nightly"]
++        for f in ["debug", "nightly"]
+     ] + [
+         # File, from, to
+         ("browser/confvars.sh",
+          "ACCEPTED_MAR_CHANNEL_IDS=firefox-mozilla-beta,firefox-mozilla-release",
+          "ACCEPTED_MAR_CHANNEL_IDS=firefox-mozilla-release"),
+         ("browser/confvars.sh",
+          "MAR_CHANNEL_ID=firefox-mozilla-beta",
+          "MAR_CHANNEL_ID=firefox-mozilla-release"),

+ 44 - 0
mozilla-release/patches/1426566-4-59a1.patch

@@ -0,0 +1,44 @@
+# HG changeset patch
+# User Gregory Szorc <gps@mozilla.com>
+# Date 1515527269 28800
+# Node ID 3e88948848f810df2f5af02cbd6ce521b6a4329d
+# Parent  f823d373b4c2b750b21b913eb1e0abda8c88265f
+Bug 1426566 - Stop removing --enable-profiling during uplift; r=froydnj
+
+This line no longer occurs in mozconfigs. So we don't need to remove
+it. moz.configure already stops implying --enable-profiling for
+non-Nightly builds.
+
+MozReview-Commit-ID: 97Yxh8Crsn8
+
+diff --git a/testing/mozharness/configs/merge_day/central_to_beta.py b/testing/mozharness/configs/merge_day/central_to_beta.py
+--- a/testing/mozharness/configs/merge_day/central_to_beta.py
++++ b/testing/mozharness/configs/merge_day/central_to_beta.py
+@@ -24,27 +24,16 @@ config = {
+         "ac_add_options --enable-official-branding")
+         for f in ["browser/config/mozconfigs/linux32/l10n-mozconfig",
+                   "browser/config/mozconfigs/linux64/l10n-mozconfig",
+                   "browser/config/mozconfigs/win32/l10n-mozconfig",
+                   "browser/config/mozconfigs/win64/l10n-mozconfig",
+                   "browser/config/mozconfigs/macosx64/l10n-mozconfig"]
+     ] + [
+         # File, from, to
+-        (f, "ac_add_options --enable-profiling", "") for f in
+-        ["mobile/android/config/mozconfigs/android-api-16/nightly",
+-         "mobile/android/config/mozconfigs/android-x86/nightly",
+-         "mobile/android/config/mozconfigs/android-aarch64/nightly",
+-         "browser/config/mozconfigs/linux32/nightly",
+-         "browser/config/mozconfigs/linux64/nightly",
+-         "browser/config/mozconfigs/macosx64/nightly",
+-         "browser/config/mozconfigs/win32/nightly",
+-         "browser/config/mozconfigs/win64/nightly"]
+-    ] + [
+-        # File, from, to
+         ("browser/confvars.sh",
+          "ACCEPTED_MAR_CHANNEL_IDS=firefox-mozilla-central",
+          "ACCEPTED_MAR_CHANNEL_IDS=firefox-mozilla-beta,firefox-mozilla-release"),
+         ("browser/confvars.sh",
+          "MAR_CHANNEL_ID=firefox-mozilla-central",
+          "MAR_CHANNEL_ID=firefox-mozilla-beta"),
+     ] + [
+         # File, from, to

+ 31 - 0
mozilla-release/patches/1428936-59a1.patch

@@ -0,0 +1,31 @@
+# HG changeset patch
+# User Aki Sasaki <asasaki@mozilla.com>
+# Date 1515460757 28800
+# Node ID 71f7a27c283c983838803f8fa1df2cda35fb770b
+# Parent  f823d373b4c2b750b21b913eb1e0abda8c88265f
+bug 1428936 - fix central-to-beta merge config for 59. r=Callek
+
+MozReview-Commit-ID: 8pXkQ6Uf6uV
+
+diff --git a/testing/mozharness/configs/merge_day/central_to_beta.py b/testing/mozharness/configs/merge_day/central_to_beta.py
+--- a/testing/mozharness/configs/merge_day/central_to_beta.py
++++ b/testing/mozharness/configs/merge_day/central_to_beta.py
+@@ -12,17 +12,17 @@ config = {
+     "replacements": [
+         # File, from, to
+         ("{}{}".format(d, f),
+         "ac_add_options --with-branding=mobile/android/branding/nightly",
+         "ac_add_options --with-branding=mobile/android/branding/beta")
+         for d in ["mobile/android/config/mozconfigs/android-api-16/",
+                   "mobile/android/config/mozconfigs/android-x86/",
+                   "mobile/android/config/mozconfigs/android-aarch64/"]
+-        for f in ["debug", "nightly", "l10n-nightly"]
++        for f in ["debug", "nightly"]
+     ] + [
+         # File, from, to
+         (f, "ac_add_options --with-branding=browser/branding/nightly",
+         "ac_add_options --enable-official-branding")
+         for f in ["browser/config/mozconfigs/linux32/l10n-mozconfig",
+                   "browser/config/mozconfigs/linux64/l10n-mozconfig",
+                   "browser/config/mozconfigs/win32/l10n-mozconfig",
+                   "browser/config/mozconfigs/win64/l10n-mozconfig",

+ 98 - 0
mozilla-release/patches/1458385-1-70a1.patch

@@ -0,0 +1,98 @@
+# HG changeset patch
+# User Tom Prince <mozilla@hocat.ca>
+# Date 1562863200 0
+# Node ID 66f52bda7e14e26235bd0a43bb68ad11775046e4
+# Parent  973b245010420871313d349918d0d3e06e43b7fc
+Bug 1458385: Set mar-channel-id from taskcluster rather than based on update-channel; r=glandium
+
+Taskgraph needs to know the correct mar-channel, so allow it to pass it into the build,
+rather than keying off the update-channel in configure. This will allow using a `mar`
+binary that doesn't have the mar-channel configured in.
+
+Differential Revision: https://phabricator.services.mozilla.com/D37480
+
+diff --git a/browser/confvars.sh b/browser/confvars.sh
+--- a/browser/confvars.sh
++++ b/browser/confvars.sh
+@@ -32,26 +32,16 @@ BROWSER_CHROME_URL=chrome://browser/cont
+ # MOZ_BRANDING_DIRECTORY is the default branding directory used when none is
+ # specified. It should never point to the "official" branding directory.
+ # For mozilla-beta, mozilla-release, or mozilla-central repositories, use
+ # "unofficial" branding.
+ # For the mozilla-aurora repository, use "aurora".
+ MOZ_BRANDING_DIRECTORY=browser/branding/unofficial
+ MOZ_OFFICIAL_BRANDING_DIRECTORY=browser/branding/official
+ MOZ_APP_ID={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+-# ACCEPTED_MAR_CHANNEL_IDS should usually be the same as the value MAR_CHANNEL_ID.
+-# If more than one ID is needed, then you should use a comma separated list
+-# of values.
+-# The MAR_CHANNEL_ID must not contain the following 3 characters: ",\t "
+-if test "$MOZ_UPDATE_CHANNEL" = "aurora"; then
+-  ACCEPTED_MAR_CHANNEL_IDS=firefox-mozilla-aurora
+-  MAR_CHANNEL_ID=firefox-mozilla-aurora
+-else
+-  ACCEPTED_MAR_CHANNEL_IDS=firefox-mozilla-release
+-  MAR_CHANNEL_ID=firefox-mozilla-release
+-fi
++
+ MOZ_PROFILE_MIGRATOR=1
+ 
+ # Enable checking that add-ons are signed by the trusted root
+ MOZ_ADDON_SIGNING=1
+ 
+ # Include the DevTools client, not just the server (which is the default)
+ MOZ_DEVTOOLS=all
+diff --git a/testing/mozharness/configs/merge_day/beta_to_release.py b/testing/mozharness/configs/merge_day/beta_to_release.py
+--- a/testing/mozharness/configs/merge_day/beta_to_release.py
++++ b/testing/mozharness/configs/merge_day/beta_to_release.py
+@@ -7,22 +7,16 @@ config = {
+     "copy_files": [
+         {
+             "src": "browser/config/version.txt",
+             "dst": "browser/config/version_display.txt",
+         },
+     ],
+     "replacements": [
+         # File, from, to
+-        ("browser/confvars.sh",
+-         "ACCEPTED_MAR_CHANNEL_IDS=firefox-mozilla-beta,firefox-mozilla-release",
+-         "ACCEPTED_MAR_CHANNEL_IDS=firefox-mozilla-release"),
+-        ("browser/confvars.sh",
+-         "MAR_CHANNEL_ID=firefox-mozilla-beta",
+-         "MAR_CHANNEL_ID=firefox-mozilla-release"),
+     ],
+ 
+     "vcs_share_base": os.path.join(ABS_WORK_DIR, 'hg-shared'),
+     # "hg_share_base": None,
+     "tools_repo_url": "https://hg.mozilla.org/build/tools",
+     "tools_repo_branch": "default",
+     "from_repo_url": "ssh://hg.mozilla.org/releases/mozilla-beta",
+     "to_repo_url": "ssh://hg.mozilla.org/releases/mozilla-release",
+diff --git a/testing/mozharness/configs/merge_day/central_to_beta.py b/testing/mozharness/configs/merge_day/central_to_beta.py
+--- a/testing/mozharness/configs/merge_day/central_to_beta.py
++++ b/testing/mozharness/configs/merge_day/central_to_beta.py
+@@ -15,24 +15,16 @@ config = {
+         "ac_add_options --enable-official-branding")
+         for f in ["browser/config/mozconfigs/linux32/l10n-mozconfig",
+                   "browser/config/mozconfigs/linux64/l10n-mozconfig",
+                   "browser/config/mozconfigs/win32/l10n-mozconfig",
+                   "browser/config/mozconfigs/win64/l10n-mozconfig",
+                   "browser/config/mozconfigs/macosx64/l10n-mozconfig"]
+     ] + [
+         # File, from, to
+-        ("browser/confvars.sh",
+-         "ACCEPTED_MAR_CHANNEL_IDS=firefox-mozilla-central",
+-         "ACCEPTED_MAR_CHANNEL_IDS=firefox-mozilla-beta,firefox-mozilla-release"),
+-        ("browser/confvars.sh",
+-         "MAR_CHANNEL_ID=firefox-mozilla-central",
+-         "MAR_CHANNEL_ID=firefox-mozilla-beta"),
+-    ] + [
+-        # File, from, to
+         ("build/mozconfig.common",
+          "MOZ_REQUIRE_SIGNING=${MOZ_REQUIRE_SIGNING-0}",
+          "MOZ_REQUIRE_SIGNING=${MOZ_REQUIRE_SIGNING-1}"),
+         ("build/mozconfig.common",
+          "# Disable enforcing that add-ons are signed by the trusted root",
+          "# Enable enforcing that add-ons are signed by the trusted root")
+     ],
+ 

+ 140 - 0
mozilla-release/patches/1458385-2-70a1.patch

@@ -0,0 +1,140 @@
+# HG changeset patch
+# User Tom Prince <mozilla@hocat.ca>
+# Date 1562863213 0
+# Node ID 1be59290f02e8bdce79be475ca7d1f6a9d6603e7
+# Parent  32b5e712e57a2e481f585f6d253de485ad007361
+Bug 1458385: Generate MARs with the appropriate channel-id explicitly; r=nthomas
+
+Rather than relying on the mar-channel-id set in the `mar` binary, set the channel
+explicitly from taskcluster. This allows us to re-use the `mar` binary between
+builds/channels.
+
+Differential Revision: https://phabricator.services.mozilla.com/D37481
+
+diff --git a/python/mozbuild/mozbuild/mach_commands.py b/python/mozbuild/mozbuild/mach_commands.py
+--- a/python/mozbuild/mozbuild/mach_commands.py
++++ b/python/mozbuild/mozbuild/mach_commands.py
+@@ -1164,19 +1164,29 @@ class Repackage(MachCommandBase):
+                      help='Mar binary path')
+     @CommandArgument('--output', '-o', type=str, required=True,
+                      help='Output filename')
+     @CommandArgument('--format', type=str, default='lzma',
+                      choices=('lzma', 'bz2'),
+                      help='Mar format')
+     @CommandArgument('--arch', type=str, required=True,
+                      help='The archtecture you are building.')
+-    def repackage_mar(self, input, mar, output, format, arch):
++    @CommandArgument('--mar-channel-id', type=str,
++                     help='Mar channel id')
++    def repackage_mar(self, input, mar, output, format, arch, mar_channel_id):
+         from mozbuild.repackaging.mar import repackage_mar
+-        repackage_mar(self.topsrcdir, input, mar, output, format, arch=arch)
++        repackage_mar(
++            self.topsrcdir,
++            input,
++            mar,
++            output,
++            format,
++            arch=arch,
++            mar_channel_id=mar_channel_id,
++        )
+ 
+ 
+ @CommandProvider
+ class CreateMachEnvironment(MachCommandBase):
+     """Create the mach virtualenvs."""
+ 
+     @Command('create-mach-environment', category='devenv',
+              description=(
+diff --git a/python/mozbuild/mozbuild/repackaging/mar.py b/python/mozbuild/mozbuild/repackaging/mar.py
+--- a/python/mozbuild/mozbuild/repackaging/mar.py
++++ b/python/mozbuild/mozbuild/repackaging/mar.py
+@@ -21,17 +21,19 @@ from mozbuild.util import (
+ 
+ _BCJ_OPTIONS = {
+     'x86': ['--x86'],
+     'x86_64': ['--x86'],
+     'aarch64': [],
+ }
+ 
+ 
+-def repackage_mar(topsrcdir, package, mar, output, mar_format='lzma', arch=None):
++def repackage_mar(
++    topsrcdir, package, mar, output, mar_format="lzma", arch=None, mar_channel_id=None
++):
+     if not zipfile.is_zipfile(package) and not tarfile.is_tarfile(package):
+         raise Exception("Package file %s is not a valid .zip or .tar file." % package)
+     if arch and arch not in _BCJ_OPTIONS:
+         raise Exception("Unknown architecture {}, available architectures: {}".format(
+             arch, list(_BCJ_OPTIONS.keys())))
+ 
+     ensureParentDir(output)
+     tmpdir = tempfile.mkdtemp()
+@@ -61,16 +63,18 @@ def repackage_mar(topsrcdir, package, ma
+ 
+         env = os.environ.copy()
+         env['MOZ_FULL_PRODUCT_VERSION'] = get_application_ini_value(tmpdir, 'App', 'Version')
+         env['MAR'] = mozpath.normpath(mar)
+         if arch:
+             env['BCJ_OPTIONS'] = ' '.join(_BCJ_OPTIONS[arch])
+         if mar_format == 'bz2':
+             env['MAR_OLD_FORMAT'] = '1'
++        if mar_channel_id:
++            env['MAR_CHANNEL_ID'] = mar_channel_id
+         # The Windows build systems have xz installed but it isn't in the path
+         # like it is on Linux and Mac OS X so just use the XZ env var so the mar
+         # generation scripts can find it.
+         xz_path = mozpath.join(topsrcdir, 'xz/xz.exe')
+         if os.path.exists(xz_path):
+             env['XZ'] = mozpath.normpath(xz_path)
+ 
+         cmd = [make_full_update, output, ffxdir]
+diff --git a/tools/update-packaging/make_full_update.sh b/tools/update-packaging/make_full_update.sh
+--- a/tools/update-packaging/make_full_update.sh
++++ b/tools/update-packaging/make_full_update.sh
+@@ -116,16 +116,20 @@ else
+   $XZ --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force "$updatemanifestv3" && mv -f "$updatemanifestv3.xz" "$updatemanifestv3"
+ fi
+ 
+ mar_command="$MAR"
+ if [[ -n $MOZ_PRODUCT_VERSION ]]
+ then
+   mar_command="$mar_command -V $MOZ_PRODUCT_VERSION"
+ fi
++if [[ -n $MAR_CHANNEL_ID ]]
++then
++  mar_command="$mar_command -H $MAR_CHANNEL_ID"
++fi
+ mar_command="$mar_command -C \"$workdir\" -c output.mar"
+ eval "$mar_command $targetfiles"
+ mv -f "$workdir/output.mar" "$archive"
+ 
+ # cleanup
+ rm -fr "$workdir"
+ 
+ notice ""
+diff --git a/tools/update-packaging/make_incremental_update.sh b/tools/update-packaging/make_incremental_update.sh
+--- a/tools/update-packaging/make_incremental_update.sh
++++ b/tools/update-packaging/make_incremental_update.sh
+@@ -346,19 +346,19 @@ else
+   $XZ --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force "$updatemanifestv3" && mv -f "$updatemanifestv3.xz" "$updatemanifestv3"
+ fi
+ 
+ mar_command="$MAR"
+ if [[ -n $MOZ_PRODUCT_VERSION ]]
+ then
+   mar_command="$mar_command -V $MOZ_PRODUCT_VERSION"
+ fi
+-if [[ -n $MOZ_CHANNEL_ID ]]
++if [[ -n $MAR_CHANNEL_ID ]]
+ then
+-  mar_command="$mar_command -H $MOZ_CHANNEL_ID"
++  mar_command="$mar_command -H $MAR_CHANNEL_ID"
+ fi
+ mar_command="$mar_command -C \"$workdir\" -c output.mar"
+ eval "$mar_command $archivefiles"
+ mv -f "$workdir/output.mar" "$archive"
+ 
+ # cleanup
+ rm -fr "$workdir"
+ 

+ 63 - 0
mozilla-release/patches/1536522-68a1.patch

@@ -0,0 +1,63 @@
+# HG changeset patch
+# User Johan Lorenzo <jlorenzo@mozilla.com>
+# Date 1553259973 0
+# Node ID a19986b12bd6c401fab6e3de19235063ff2f067f
+# Parent  65526e34704fdff8b319b6251aefde8a01636b69
+Bug 1536522 - Let mergeday scripts handle missing Android mozconfigs r=aki,nalexander
+
+Let mergeday scripts handle missing Android mozconfigs
+
+Differential Revision: https://phabricator.services.mozilla.com/D24343
+
+diff --git a/testing/mozharness/configs/merge_day/beta_to_release.py b/testing/mozharness/configs/merge_day/beta_to_release.py
+--- a/testing/mozharness/configs/merge_day/beta_to_release.py
++++ b/testing/mozharness/configs/merge_day/beta_to_release.py
+@@ -10,19 +10,20 @@ config = {
+             "dst": "browser/config/version_display.txt",
+         },
+     ],
+     "replacements": [
+         # File, from, to
+         ("{}{}".format(d, f),
+         "ac_add_options --with-branding=mobile/android/branding/beta",
+         "ac_add_options --with-branding=mobile/android/branding/official")
+-        for d in ["mobile/android/config/mozconfigs/android-api-16/",
++        for d in ["mobile/android/config/mozconfigs/android-aarch64/"
++                  "mobile/android/config/mozconfigs/android-api-16/",
+                   "mobile/android/config/mozconfigs/android-x86/",
+-                  "mobile/android/config/mozconfigs/android-aarch64/"]
++                  "mobile/android/config/mozconfigs/android-x86_64/"]
+         for f in ["debug", "nightly"]
+     ] + [
+         # File, from, to
+         ("browser/confvars.sh",
+          "ACCEPTED_MAR_CHANNEL_IDS=firefox-mozilla-beta,firefox-mozilla-release",
+          "ACCEPTED_MAR_CHANNEL_IDS=firefox-mozilla-release"),
+         ("browser/confvars.sh",
+          "MAR_CHANNEL_ID=firefox-mozilla-beta",
+diff --git a/testing/mozharness/configs/merge_day/central_to_beta.py b/testing/mozharness/configs/merge_day/central_to_beta.py
+--- a/testing/mozharness/configs/merge_day/central_to_beta.py
++++ b/testing/mozharness/configs/merge_day/central_to_beta.py
+@@ -9,19 +9,20 @@ config = {
+         {"file": "browser/config/version_display.txt", "suffix": "b1"},
+         {"file": "config/milestone.txt", "suffix": ""},
+     ],
+     "replacements": [
+         # File, from, to
+         ("{}{}".format(d, f),
+         "ac_add_options --with-branding=mobile/android/branding/nightly",
+         "ac_add_options --with-branding=mobile/android/branding/beta")
+-        for d in ["mobile/android/config/mozconfigs/android-api-16/",
++        for d in ["mobile/android/config/mozconfigs/android-aarch64/"
++                  "mobile/android/config/mozconfigs/android-api-16/",
+                   "mobile/android/config/mozconfigs/android-x86/",
+-                  "mobile/android/config/mozconfigs/android-aarch64/"]
++                  "mobile/android/config/mozconfigs/android-x86_64/"]
+         for f in ["debug", "nightly"]
+     ] + [
+         # File, from, to
+         (f, "ac_add_options --with-branding=browser/branding/nightly",
+         "ac_add_options --enable-official-branding")
+         for f in ["browser/config/mozconfigs/linux32/l10n-mozconfig",
+                   "browser/config/mozconfigs/linux64/l10n-mozconfig",
+                   "browser/config/mozconfigs/win32/l10n-mozconfig",

+ 53 - 0
mozilla-release/patches/1538475-68a1.patch

@@ -0,0 +1,53 @@
+# HG changeset patch
+# User Sebastian Hengst <archaeopteryx@coole-files.de>
+# Date 1553505285 0
+# Node ID 4d546ab0dc943dd8881899fb312ba9b45b813e13
+# Parent  4666df60b091cc4b68bf6b297b53d6933f0d1005
+Bug 1538475 - Add comma to 'central-to-beta' and 'beta-to-release' generators to prevent concatenation of two folder paths of files to modify r=jlorenzo
+
+Differential Revision: https://phabricator.services.mozilla.com/D24602
+
+diff --git a/testing/mozharness/configs/merge_day/beta_to_release.py b/testing/mozharness/configs/merge_day/beta_to_release.py
+--- a/testing/mozharness/configs/merge_day/beta_to_release.py
++++ b/testing/mozharness/configs/merge_day/beta_to_release.py
+@@ -10,17 +10,17 @@ config = {
+             "dst": "browser/config/version_display.txt",
+         },
+     ],
+     "replacements": [
+         # File, from, to
+         ("{}{}".format(d, f),
+         "ac_add_options --with-branding=mobile/android/branding/beta",
+         "ac_add_options --with-branding=mobile/android/branding/official")
+-        for d in ["mobile/android/config/mozconfigs/android-aarch64/"
++        for d in ["mobile/android/config/mozconfigs/android-aarch64/",
+                   "mobile/android/config/mozconfigs/android-api-16/",
+                   "mobile/android/config/mozconfigs/android-x86/",
+                   "mobile/android/config/mozconfigs/android-x86_64/"]
+         for f in ["debug", "nightly"]
+     ] + [
+         # File, from, to
+         ("browser/confvars.sh",
+          "ACCEPTED_MAR_CHANNEL_IDS=firefox-mozilla-beta,firefox-mozilla-release",
+diff --git a/testing/mozharness/configs/merge_day/central_to_beta.py b/testing/mozharness/configs/merge_day/central_to_beta.py
+--- a/testing/mozharness/configs/merge_day/central_to_beta.py
++++ b/testing/mozharness/configs/merge_day/central_to_beta.py
+@@ -9,17 +9,17 @@ config = {
+         {"file": "browser/config/version_display.txt", "suffix": "b1"},
+         {"file": "config/milestone.txt", "suffix": ""},
+     ],
+     "replacements": [
+         # File, from, to
+         ("{}{}".format(d, f),
+         "ac_add_options --with-branding=mobile/android/branding/nightly",
+         "ac_add_options --with-branding=mobile/android/branding/beta")
+-        for d in ["mobile/android/config/mozconfigs/android-aarch64/"
++        for d in ["mobile/android/config/mozconfigs/android-aarch64/",
+                   "mobile/android/config/mozconfigs/android-api-16/",
+                   "mobile/android/config/mozconfigs/android-x86/",
+                   "mobile/android/config/mozconfigs/android-x86_64/"]
+         for f in ["debug", "nightly"]
+     ] + [
+         # File, from, to
+         (f, "ac_add_options --with-branding=browser/branding/nightly",
+         "ac_add_options --enable-official-branding")

+ 42 - 0
mozilla-release/patches/1546320-PARTIAL-68a1.patch

@@ -0,0 +1,42 @@
+# HG changeset patch
+# User Johan Lorenzo <jlorenzo@mozilla.com>
+# Date 1556632668 0
+# Node ID 486f55e81c5708dfe3da9b346097d2909720e2d5
+# Parent  5431bef5c32b6c069c859cbba01aa28ba082fe91
+Bug 1546320 - Create mozconfigs for Fennec beta builds r=RyanVM
+
+Create mozconfigs for Fennec beta builds.
+This also prevents mergeday scripts from modifying nightly mozconfigs on beta
+
+Differential Revision: https://phabricator.services.mozilla.com/D29350
+
+diff --git a/testing/mozharness/configs/merge_day/central_to_beta.py b/testing/mozharness/configs/merge_day/central_to_beta.py
+--- a/testing/mozharness/configs/merge_day/central_to_beta.py
++++ b/testing/mozharness/configs/merge_day/central_to_beta.py
+@@ -6,26 +6,16 @@ config = {
+     "log_name": "central_to_beta",
+     "version_files": [
+         {"file": "browser/config/version.txt", "suffix": ""},
+         {"file": "browser/config/version_display.txt", "suffix": "b1"},
+         {"file": "config/milestone.txt", "suffix": ""},
+     ],
+     "replacements": [
+         # File, from, to
+-        ("{}{}".format(d, f),
+-        "ac_add_options --with-branding=mobile/android/branding/nightly",
+-        "ac_add_options --with-branding=mobile/android/branding/beta")
+-        for d in ["mobile/android/config/mozconfigs/android-aarch64/",
+-                  "mobile/android/config/mozconfigs/android-api-16/",
+-                  "mobile/android/config/mozconfigs/android-x86/",
+-                  "mobile/android/config/mozconfigs/android-x86_64/"]
+-        for f in ["debug", "nightly"]
+-    ] + [
+-        # File, from, to
+         (f, "ac_add_options --with-branding=browser/branding/nightly",
+         "ac_add_options --enable-official-branding")
+         for f in ["browser/config/mozconfigs/linux32/l10n-mozconfig",
+                   "browser/config/mozconfigs/linux64/l10n-mozconfig",
+                   "browser/config/mozconfigs/win32/l10n-mozconfig",
+                   "browser/config/mozconfigs/win64/l10n-mozconfig",
+                   "browser/config/mozconfigs/macosx64/l10n-mozconfig"]
+     ] + [

+ 39 - 0
mozilla-release/patches/1546322-69a1.patch

@@ -0,0 +1,39 @@
+# HG changeset patch
+# User Johan Lorenzo <jlorenzo@mozilla.com>
+# Date 1559140532 0
+# Node ID 7613b6467c73488fe3f23e8ba1b527e75e61339c
+# Parent  5431bef5c32b6c069c859cbba01aa28ba082fe91
+Bug 1546322 - Modify merge scripts to not modify Fennec mozconfigs anymore r=sfraser
+
+Differential Revision: https://phabricator.services.mozilla.com/D33014
+
+diff --git a/testing/mozharness/configs/merge_day/beta_to_release.py b/testing/mozharness/configs/merge_day/beta_to_release.py
+--- a/testing/mozharness/configs/merge_day/beta_to_release.py
++++ b/testing/mozharness/configs/merge_day/beta_to_release.py
+@@ -7,26 +7,16 @@ config = {
+     "copy_files": [
+         {
+             "src": "browser/config/version.txt",
+             "dst": "browser/config/version_display.txt",
+         },
+     ],
+     "replacements": [
+         # File, from, to
+-        ("{}{}".format(d, f),
+-        "ac_add_options --with-branding=mobile/android/branding/beta",
+-        "ac_add_options --with-branding=mobile/android/branding/official")
+-        for d in ["mobile/android/config/mozconfigs/android-aarch64/",
+-                  "mobile/android/config/mozconfigs/android-api-16/",
+-                  "mobile/android/config/mozconfigs/android-x86/",
+-                  "mobile/android/config/mozconfigs/android-x86_64/"]
+-        for f in ["debug", "nightly"]
+-    ] + [
+-        # File, from, to
+         ("browser/confvars.sh",
+          "ACCEPTED_MAR_CHANNEL_IDS=firefox-mozilla-beta,firefox-mozilla-release",
+          "ACCEPTED_MAR_CHANNEL_IDS=firefox-mozilla-release"),
+         ("browser/confvars.sh",
+          "MAR_CHANNEL_ID=firefox-mozilla-beta",
+          "MAR_CHANNEL_ID=firefox-mozilla-release"),
+     ],
+ 

+ 35 - 0
mozilla-release/patches/1577664-70a1.patch

@@ -0,0 +1,35 @@
+# HG changeset patch
+# User Nick Thomas <nthomas@mozilla.com>
+# Date 1567128908 0
+# Node ID ca2208744242590c1350dd7c217d5db4cfbfc8cf
+# Parent  cd8ceb047946a52d746b495d82cd2ae832f82bde
+Bug 1577664 - pass product version to the complete mar generation script, r=Callek
+
+MOZ_FULL_PRODUCT_VERSION is only used here, while tools/update-packaging/make_full_update.sh expects MOZ_PRODUCT_VERSION.
+
+Depends on D44089
+
+Differential Revision: https://phabricator.services.mozilla.com/D44090
+
+diff --git a/python/mozbuild/mozbuild/repackaging/mar.py b/python/mozbuild/mozbuild/repackaging/mar.py
+--- a/python/mozbuild/mozbuild/repackaging/mar.py
++++ b/python/mozbuild/mozbuild/repackaging/mar.py
+@@ -57,17 +57,17 @@ def repackage_mar(
+         if len(toplevel_dirs) != 1:
+             raise Exception("Package file is expected to have a single top-level directory"
+                             "(eg: 'firefox'), not: %s" % toplevel_dirs)
+         ffxdir = mozpath.join(tmpdir, toplevel_dirs.pop())
+ 
+         make_full_update = mozpath.join(topsrcdir, 'tools/update-packaging/make_full_update.sh')
+ 
+         env = os.environ.copy()
+-        env['MOZ_FULL_PRODUCT_VERSION'] = get_application_ini_value(tmpdir, 'App', 'Version')
++        env['MOZ_PRODUCT_VERSION'] = get_application_ini_value(tmpdir, 'App', 'Version')
+         env['MAR'] = mozpath.normpath(mar)
+         if arch:
+             env['BCJ_OPTIONS'] = ' '.join(_BCJ_OPTIONS[arch])
+         if mar_format == 'bz2':
+             env['MAR_OLD_FORMAT'] = '1'
+         if mar_channel_id:
+             env['MAR_CHANNEL_ID'] = mar_channel_id
+         # The Windows build systems have xz installed but it isn't in the path

+ 115 - 0
mozilla-release/patches/1577760-71a1.patch

@@ -0,0 +1,115 @@
+# HG changeset patch
+# User Tom Prince <mozilla@hocat.ca>
+# Date 1567795034 0
+# Node ID 9ace34dfde8de6b2d8ac78c7b342b6256d529153
+# Parent  fd0f39f7252715562562da4c03cc8b57fb200b8b
+Bug 1577760: Don't compile in version of mar-channel-id in `mar` tool; r=rstrong
+
+Differential Revision: https://phabricator.services.mozilla.com/D44157
+
+diff --git a/modules/libmar/tool/mar.c b/modules/libmar/tool/mar.c
+--- a/modules/libmar/tool/mar.c
++++ b/modules/libmar/tool/mar.c
+@@ -33,17 +33,17 @@ static void print_version() {
+   printf("Version: %s\n", MOZ_APP_VERSION);
+   printf("Default Channel ID: %s\n", MAR_CHANNEL_ID);
+ }
+ 
+ static void print_usage() {
+   printf("usage:\n");
+   printf("Create a MAR file:\n");
+   printf(
+-      "  mar [-H MARChannelID] [-V ProductVersion] [-C workingDir] "
++      "  mar -H MARChannelID -V ProductVersion [-C workingDir] "
+       "-c archive.mar [files...]\n");
+ 
+   printf("Extract a MAR file:\n");
+   printf("  mar [-C workingDir] -x archive.mar\n");
+ #ifndef NO_SIGN_VERIFY
+   printf("Sign a MAR file:\n");
+   printf(
+       "  mar [-C workingDir] -d NSSConfigDir -n certname -s "
+@@ -90,17 +90,17 @@ static void print_usage() {
+   printf("Print information on a MAR file:\n");
+   printf("  mar -t archive.mar\n");
+ 
+   printf("Print detailed information on a MAR file including signatures:\n");
+   printf("  mar -T archive.mar\n");
+ 
+   printf("Refresh the product information block of a MAR file:\n");
+   printf(
+-      "  mar [-H MARChannelID] [-V ProductVersion] [-C workingDir] "
++      "  mar -H MARChannelID -V ProductVersion [-C workingDir] "
+       "-i unsigned_archive_to_refresh.mar\n");
+ 
+   printf("Print executable version:\n");
+   printf("  mar --version\n");
+   printf("This program does not handle unicode file paths properly\n");
+ }
+ 
+ static int mar_test_callback(MarFile *mar, const MarItem *item, void *unused) {
+@@ -121,18 +121,18 @@ static int mar_test(const char *path) {
+ 
+   mar_close(mar);
+   return 0;
+ }
+ 
+ int main(int argc, char **argv) {
+   char *NSSConfigDir = NULL;
+   const char *certNames[MAX_SIGNATURES];
+-  char *MARChannelID = MAR_CHANNEL_ID;
+-  char *productVersion = MOZ_APP_VERSION;
++  char* MARChannelID = NULL;
++  char* productVersion = NULL;
+   uint32_t k;
+   int rv = -1;
+   uint32_t certCount = 0;
+   int32_t sigIndex = -1;
+ 
+ #if !defined(NO_SIGN_VERIFY)
+   uint32_t fileSizes[MAX_SIGNATURES];
+   const uint8_t *certBuffers[MAX_SIGNATURES];
+@@ -240,21 +240,43 @@ int main(int argc, char **argv) {
+   if (argv[1][0] != '-') {
+     print_usage();
+     return -1;
+   }
+ 
+   switch (argv[1][1]) {
+     case 'c': {
+       struct ProductInformationBlock infoBlock;
++      if (!productVersion) {
++        fprintf(stderr,
++                "ERROR: Version not specified (pass `-V <version>`).\n");
++        return -1;
++      }
++      if (!MARChannelID) {
++        fprintf(stderr,
++                "ERROR: MAR channel ID not specified (pass `-H "
++                "<mar-channel-id>`).\n");
++        return -1;
++      }
+       infoBlock.MARChannelID = MARChannelID;
+       infoBlock.productVersion = productVersion;
+       return mar_create(argv[2], argc - 3, argv + 3, &infoBlock);
+     }
+     case 'i': {
++      if (!productVersion) {
++        fprintf(stderr,
++                "ERROR: Version not specified (pass `-V <version>`).\n");
++        return -1;
++      }
++      if (!MARChannelID) {
++        fprintf(stderr,
++                "ERROR: MAR channel ID not specified (pass `-H "
++                "<mar-channel-id>`).\n");
++        return -1;
++      }
+       struct ProductInformationBlock infoBlock;
+       infoBlock.MARChannelID = MARChannelID;
+       infoBlock.productVersion = productVersion;
+       return refresh_product_info_block(argv[2], &infoBlock);
+     }
+     case 'T': {
+       struct ProductInformationBlock infoBlock;
+       uint32_t numSignatures, numAdditionalBlocks;

+ 33 - 0
mozilla-release/patches/1632531-1only-PARTIAL-77a1.patch

@@ -0,0 +1,33 @@
+# HG changeset patch
+# User Simon Fraser <sfraser@mozilla.com>
+# Date 1587677864 0
+# Node ID 89c68daa37768c52fc5849c1bbbb8906f5c79ef3
+# Parent  119a315026c92b9e0fa675deb0ee5551a1d2d660
+Bug 1632531 - Ensure unique working directory for parallel use. r=mtabara
+
+Bug 1632531 Refactor funsize/partials to remove unused code, add safer checks
+
+Differential Revision: https://phabricator.services.mozilla.com/D72162
+
+diff --git a/tools/update-packaging/make_incremental_update.sh b/tools/update-packaging/make_incremental_update.sh
+--- a/tools/update-packaging/make_incremental_update.sh
++++ b/tools/update-packaging/make_incremental_update.sh
+@@ -104,17 +104,17 @@ archive="$1"
+ olddir="$2"
+ newdir="$3"
+ # Prevent the workdir from being inside the targetdir so it isn't included in
+ # the update mar.
+ if [ $(echo "$newdir" | grep -c '\/$') = 1 ]; then
+   # Remove the /
+   newdir=$(echo "$newdir" | sed -e 's:\/$::')
+ fi
+-workdir="$newdir.work"
++workdir="$(mktemp -d)"
+ updatemanifestv2="$workdir/updatev2.manifest"
+ updatemanifestv3="$workdir/updatev3.manifest"
+ archivefiles="updatev2.manifest updatev3.manifest"
+ 
+ mkdir -p "$workdir"
+ 
+ # Generate a list of all files in the target directory.
+ pushd "$olddir"

+ 63 - 0
mozilla-release/patches/1635321-78a1.patch

@@ -0,0 +1,63 @@
+# HG changeset patch
+# User Simon Fraser <sfraser@mozilla.com>
+# Date 1589512928 0
+# Node ID d711609b40a594536c51543c28ae36e86a8cf8a1
+# Parent  119a315026c92b9e0fa675deb0ee5551a1d2d660
+Bug 1635321 update-packaging race condition fixes r=nthomas
+
+conflicts with D75072, we should choose which we prefer based on bash version availability
+
+Differential Revision: https://phabricator.services.mozilla.com/D75285
+
+diff --git a/tools/update-packaging/common.sh b/tools/update-packaging/common.sh
+--- a/tools/update-packaging/common.sh
++++ b/tools/update-packaging/common.sh
+@@ -190,39 +190,37 @@ append_remove_instructions() {
+     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
+-
++  temp_filelist=$(mktemp)
+   find . -type f \
+     ! -name "update.manifest" \
+     ! -name "updatev2.manifest" \
+     ! -name "updatev3.manifest" \
+-    ! -name "temp-dirlist" \
+-    ! -name "temp-filelist" \
+     | sed 's/\.\/\(.*\)/\1/' \
+-    | sort -r > "temp-filelist"
++    | sort -r > "${temp_filelist}"
+   while read file; do
+     eval "${1}[$count]=\"$file\""
+     (( count++ ))
+-  done < "temp-filelist"
+-  rm "temp-filelist"
++  done < "${temp_filelist}"
++  rm "${temp_filelist}"
+ }
+ 
+ # List all directories in the current directory, stripping leading "./"
+ list_dirs() {
+   count=0
+-
++  temp_dirlist=$(mktemp)
+   find . -type d \
+     ! -name "." \
+     ! -name ".." \
+     | sed 's/\.\/\(.*\)/\1/' \
+-    | sort -r > "temp-dirlist"
++    | sort -r > "${temp_dirlist}"
+   while read dir; do
+     eval "${1}[$count]=\"$dir\""
+     (( count++ ))
+-  done < "temp-dirlist"
+-  rm "temp-dirlist"
+-}
++  done < "${temp_dirlist}"
++  rm "${temp_dirlist}"
++}

+ 312 - 0
mozilla-release/patches/1641329-78a1.patch

@@ -0,0 +1,312 @@
+# HG changeset patch
+# User Mark Smith <mcs@pearlcrescent.com>
+# Date 1590758326 0
+# Node ID cb93af886469eb4e622a0be1ab73434de0b958d8
+# Parent  9c00e27173af706ea2de2a6cd564ddc49b23069d
+Bug 1641329 - Add -q option to MAR generation scripts r=nthomas
+
+Differential Revision: https://phabricator.services.mozilla.com/D77138
+
+diff --git a/tools/update-packaging/common.sh b/tools/update-packaging/common.sh
+--- a/tools/update-packaging/common.sh
++++ b/tools/update-packaging/common.sh
+@@ -4,16 +4,18 @@
+ # file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ 
+ #
+ # Code shared by update packaging scripts.
+ # Author: Darin Fisher
+ #
+ 
+ # -----------------------------------------------------------------------------
++QUIET=0
++
+ # By default just assume that these tools exist on our path
+ MAR=${MAR:-mar}
+ MBSDIFF=${MBSDIFF:-mbsdiff}
+ if [[ -z "${MAR_OLD_FORMAT}" ]]; then
+   XZ=${XZ:-xz}
+   $XZ --version > /dev/null 2>&1
+   if [ $? -ne 0 ]; then
+     # If $XZ is not set and not found on the path then this is probably
+@@ -39,16 +41,22 @@ fi
+ 
+ # -----------------------------------------------------------------------------
+ # Helper routines
+ 
+ notice() {
+   echo "$*" 1>&2
+ }
+ 
++verbose_notice() {
++  if [ $QUIET -eq 0 ]; then
++    notice "$*"
++  fi
++}
++
+ get_file_size() {
+   info=($(ls -ln "$1"))
+   echo ${info[4]}
+ }
+ 
+ copy_perm() {
+   reference="$1"
+   target="$2"
+@@ -77,23 +85,23 @@ make_add_instruction() {
+     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\""
++    verbose_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"
++    verbose_notice "        add \"$f\"$forced"
+     echo "add \"$f\"" >> "$filev2"
+     if [ ! "$filev3" = "" ]; then
+       echo "add \"$f\"" >> "$filev3"
+     fi
+   fi
+ }
+ 
+ check_for_add_if_not_update() {
+@@ -118,35 +126,35 @@ check_for_add_to_manifestv2() {
+   ## 'false'... because this is bash. Oh yay!
+   return 1;
+ }
+ 
+ make_add_if_not_instruction() {
+   f="$1"
+   filev3="$2"
+ 
+-  notice " add-if-not \"$f\" \"$f\""
++  verbose_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\""
++    verbose_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\""
++    verbose_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"
+@@ -166,27 +174,27 @@ append_remove_instructions() {
+       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\""
++            verbose_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\""
++            verbose_notice "    rmrfdir \"$f\""
+             echo "rmrfdir \"$f\"" >> "$filev2"
+             echo "rmrfdir \"$f\"" >> "$filev3"
+           else
+-            notice "     remove \"$f\""
++            verbose_notice "     remove \"$f\""
+             echo "remove \"$f\"" >> "$filev2"
+             echo "remove \"$f\"" >> "$filev3"
+           fi
+         fi
+       fi
+     done
+   fi
+ }
+diff --git a/tools/update-packaging/make_full_update.sh b/tools/update-packaging/make_full_update.sh
+--- a/tools/update-packaging/make_full_update.sh
++++ b/tools/update-packaging/make_full_update.sh
+@@ -23,20 +23,26 @@ 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 "  -q  be less verbose"
+   notice ""
+   exit 1
+ fi
+ 
++if [ $1 = -q ]; then
++  QUIET=1
++  shift
++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 /
+diff --git a/tools/update-packaging/make_incremental_update.sh b/tools/update-packaging/make_incremental_update.sh
+--- a/tools/update-packaging/make_incremental_update.sh
++++ b/tools/update-packaging/make_incremental_update.sh
+@@ -16,16 +16,17 @@ print_usage() {
+   notice "Usage: $(basename $0) [OPTIONS] ARCHIVE FROMDIR TODIR"
+   notice ""
+   notice "The differences between FROMDIR and TODIR will be stored in ARCHIVE."
+   notice ""
+   notice "Options:"
+   notice "  -h  show this help text"
+   notice "  -f  clobber this file in the installation"
+   notice "      Must be a path to a file to clobber in the partial update."
++  notice "  -q  be less verbose"
+   notice ""
+ }
+ 
+ check_for_forced_update() {
+   force_list="$1"
+   forced_file_chk="$2"
+ 
+   local f
+@@ -78,21 +79,23 @@ check_for_forced_update() {
+ 
+ if [ $# = 0 ]; then
+   print_usage
+   exit 1
+ fi
+ 
+ requested_forced_updates='Contents/MacOS/firefox'
+ 
+-while getopts "hf:" flag
++while getopts "hqf:" flag
+ do
+    case "$flag" in
+       h) print_usage; exit 0
+       ;;
++      q) QUIET=1
++      ;;
+       f) requested_forced_updates="$requested_forced_updates $OPTARG"
+       ;;
+       ?) print_usage; exit 1
+       ;;
+    esac
+ done
+ 
+ # -----------------------------------------------------------------------------
+@@ -194,17 +197,17 @@ for ((i=0; $i<$num_oldfiles; i=$i+1)); d
+       continue 1
+     fi
+ 
+     if ! diff "$olddir/$f" "$newdir/$f" > /dev/null; then
+       # Compute both the compressed binary diff and the compressed file, and
+       # compare the sizes.  Then choose the smaller of the two to package.
+       dir=$(dirname "$workdir/$f")
+       mkdir -p "$dir"
+-      notice "diffing \"$f\""
++      verbose_notice "diffing \"$f\""
+       # MBSDIFF_HOOK represents the communication interface with funsize and,
+       # if enabled, caches the intermediate patches for future use and
+       # compute avoidance
+       #
+       # An example of MBSDIFF_HOOK env variable could look like this:
+       # export MBSDIFF_HOOK="myscript.sh -A https://funsize/api -c /home/user"
+       # where myscript.sh has the following usage:
+       # myscript.sh -A SERVER-URL [-c LOCAL-CACHE-DIR-PATH] [-g] [-u] \
+@@ -219,26 +222,26 @@ for ((i=0; $i<$num_oldfiles; i=$i+1)); d
+           $BZIP2 -z9 "$workdir/$f.patch"
+         else
+           $XZ --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force "$workdir/$f.patch"
+         fi
+       else
+         # if service enabled then check patch existence for retrieval
+         if [[ -n $MAR_OLD_FORMAT ]]; then
+           if $MBSDIFF_HOOK -g "$olddir/$f" "$newdir/$f" "$workdir/$f.patch.bz2"; then
+-            notice "file \"$f\" found in funsize, diffing skipped"
++            verbose_notice "file \"$f\" found in funsize, diffing skipped"
+           else
+             # if not found already - compute it and cache it for future use
+             $MBSDIFF "$olddir/$f" "$newdir/$f" "$workdir/$f.patch"
+             $BZIP2 -z9 "$workdir/$f.patch"
+             $MBSDIFF_HOOK -u "$olddir/$f" "$newdir/$f" "$workdir/$f.patch.bz2"
+           fi
+         else
+           if $MBSDIFF_HOOK -g "$olddir/$f" "$newdir/$f" "$workdir/$f.patch.xz"; then
+-            notice "file \"$f\" found in funsize, diffing skipped"
++            verbose_notice "file \"$f\" found in funsize, diffing skipped"
+           else
+             # if not found already - compute it and cache it for future use
+             $MBSDIFF "$olddir/$f" "$newdir/$f" "$workdir/$f.patch"
+             $XZ --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force "$workdir/$f.patch"
+             $MBSDIFF_HOOK -u "$olddir/$f" "$newdir/$f" "$workdir/$f.patch.xz"
+           fi
+         fi
+       fi
+@@ -309,17 +312,17 @@ for ((i=0; $i<$num_newfiles; i=$i+1)); d
+ 
+   archivefiles="$archivefiles \"$f\""
+ done
+ 
+ notice ""
+ notice "Adding file remove instructions to update manifests"
+ for ((i=0; $i<$num_removes; i=$i+1)); do
+   f="${remove_array[$i]}"
+-  notice "     remove \"$f\""
++  verbose_notice "     remove \"$f\""
+   echo "remove \"$f\"" >> $updatemanifestv2
+   echo "remove \"$f\"" >> $updatemanifestv3
+ done
+ 
+ # Add remove instructions for any dead files.
+ notice ""
+ notice "Adding file and directory remove instructions from file 'removed-files'"
+ append_remove_instructions "$newdir" "$updatemanifestv2" "$updatemanifestv3"
+@@ -327,17 +330,17 @@ append_remove_instructions "$newdir" "$u
+ notice ""
+ notice "Adding directory remove instructions for directories that no longer exist"
+ num_olddirs=${#olddirs[*]}
+ 
+ for ((i=0; $i<$num_olddirs; i=$i+1)); do
+   f="${olddirs[$i]}"
+   # If this dir doesn't exist in the new directory remove it.
+   if [ ! -d "$newdir/$f" ]; then
+-    notice "      rmdir $f/"
++    verbose_notice "      rmdir $f/"
+     echo "rmdir \"$f/\"" >> $updatemanifestv2
+     echo "rmdir \"$f/\"" >> $updatemanifestv3
+   fi
+ done
+ 
+ if [[ -n $MAR_OLD_FORMAT ]]; then
+   $BZIP2 -z9 "$updatemanifestv2" && mv -f "$updatemanifestv2.bz2" "$updatemanifestv2"
+   $BZIP2 -z9 "$updatemanifestv3" && mv -f "$updatemanifestv3.bz2" "$updatemanifestv3"

+ 105 - 0
mozilla-release/patches/1643188-79a1.patch

@@ -0,0 +1,105 @@
+# HG changeset patch
+# User Adam Gashlin <agashlin@mozilla.com>
+# Date 1591347533 0
+# Node ID 3b36b8fb5847ebda5ef92e6ad25898a07dacd8e3
+# Parent  5991094db7cecd53b1b735caf9d55062403ddedf
+Bug 1643188 - Require MOZ_PRODUCT_VERSION and MAR_CHANNEL_ID for update scripts. r=sfraser
+
+Differential Revision: https://phabricator.services.mozilla.com/D78209
+
+diff --git a/tools/update-packaging/make_full_update.sh b/tools/update-packaging/make_full_update.sh
+--- a/tools/update-packaging/make_full_update.sh
++++ b/tools/update-packaging/make_full_update.sh
+@@ -35,16 +35,18 @@ fi
+ 
+ if [ $1 = -q ]; then
+   QUIET=1
+   shift
+ fi
+ 
+ # -----------------------------------------------------------------------------
+ 
++mar_command="$MAR -V ${MOZ_PRODUCT_VERSION:?} -H ${MAR_CHANNEL_ID:?}"
++
+ 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
+@@ -117,25 +119,16 @@ append_remove_instructions "$targetdir" 
+ if [[ -n $MAR_OLD_FORMAT ]]; then
+   $BZIP2 -z9 "$updatemanifestv2" && mv -f "$updatemanifestv2.bz2" "$updatemanifestv2"
+   $BZIP2 -z9 "$updatemanifestv3" && mv -f "$updatemanifestv3.bz2" "$updatemanifestv3"
+ else
+   $XZ --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force "$updatemanifestv2" && mv -f "$updatemanifestv2.xz" "$updatemanifestv2"
+   $XZ --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force "$updatemanifestv3" && mv -f "$updatemanifestv3.xz" "$updatemanifestv3"
+ fi
+ 
+-mar_command="$MAR"
+-if [[ -n $MOZ_PRODUCT_VERSION ]]
+-then
+-  mar_command="$mar_command -V $MOZ_PRODUCT_VERSION"
+-fi
+-if [[ -n $MAR_CHANNEL_ID ]]
+-then
+-  mar_command="$mar_command -H $MAR_CHANNEL_ID"
+-fi
+ mar_command="$mar_command -C \"$workdir\" -c output.mar"
+ eval "$mar_command $targetfiles"
+ mv -f "$workdir/output.mar" "$archive"
+ 
+ # cleanup
+ rm -fr "$workdir"
+ 
+ notice ""
+diff --git a/tools/update-packaging/make_incremental_update.sh b/tools/update-packaging/make_incremental_update.sh
+--- a/tools/update-packaging/make_incremental_update.sh
++++ b/tools/update-packaging/make_incremental_update.sh
+@@ -95,16 +95,18 @@ do
+       ;;
+       ?) print_usage; exit 1
+       ;;
+    esac
+ done
+ 
+ # -----------------------------------------------------------------------------
+ 
++mar_command="$MAR -V ${MOZ_PRODUCT_VERSION:?} -H ${MAR_CHANNEL_ID:?}"
++
+ let arg_start=$OPTIND-1
+ shift $arg_start
+ 
+ archive="$1"
+ olddir="$2"
+ newdir="$3"
+ # Prevent the workdir from being inside the targetdir so it isn't included in
+ # the update mar.
+@@ -344,25 +346,16 @@ done
+ if [[ -n $MAR_OLD_FORMAT ]]; then
+   $BZIP2 -z9 "$updatemanifestv2" && mv -f "$updatemanifestv2.bz2" "$updatemanifestv2"
+   $BZIP2 -z9 "$updatemanifestv3" && mv -f "$updatemanifestv3.bz2" "$updatemanifestv3"
+ else
+   $XZ --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force "$updatemanifestv2" && mv -f "$updatemanifestv2.xz" "$updatemanifestv2"
+   $XZ --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force "$updatemanifestv3" && mv -f "$updatemanifestv3.xz" "$updatemanifestv3"
+ fi
+ 
+-mar_command="$MAR"
+-if [[ -n $MOZ_PRODUCT_VERSION ]]
+-then
+-  mar_command="$mar_command -V $MOZ_PRODUCT_VERSION"
+-fi
+-if [[ -n $MAR_CHANNEL_ID ]]
+-then
+-  mar_command="$mar_command -H $MAR_CHANNEL_ID"
+-fi
+ mar_command="$mar_command -C \"$workdir\" -c output.mar"
+ eval "$mar_command $archivefiles"
+ mv -f "$workdir/output.mar" "$archive"
+ 
+ # cleanup
+ rm -fr "$workdir"
+ 
+ notice ""

+ 50 - 0
mozilla-release/patches/1643211-79a1.patch

@@ -0,0 +1,50 @@
+# HG changeset patch
+# User Adam Gashlin <agashlin@mozilla.com>
+# Date 1591571745 0
+# Node ID ad757ab87752333e8578fa2fcc2416f4a2c42926
+# Parent  b0109b3e24e7cd0baa222a53eb64f6003722dbf4
+Bug 1643211 - Don't use BCJ on patches. r=sfraser
+
+Differential Revision: https://phabricator.services.mozilla.com/D78213
+
+diff --git a/tools/update-packaging/make_incremental_update.sh b/tools/update-packaging/make_incremental_update.sh
+--- a/tools/update-packaging/make_incremental_update.sh
++++ b/tools/update-packaging/make_incremental_update.sh
+@@ -218,17 +218,17 @@ for ((i=0; $i<$num_oldfiles; i=$i+1)); d
+       # Note: patches are bzipped or xz stashed in funsize to gain more speed
+ 
+       # if service is not enabled then default to old behavior
+       if [ -z "$MBSDIFF_HOOK" ]; then
+         $MBSDIFF "$olddir/$f" "$newdir/$f" "$workdir/$f.patch"
+         if [[ -n $MAR_OLD_FORMAT ]]; then
+           $BZIP2 -z9 "$workdir/$f.patch"
+         else
+-          $XZ --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force "$workdir/$f.patch"
++          $XZ --compress --lzma2 --format=xz --check=crc64 --force "$workdir/$f.patch"
+         fi
+       else
+         # if service enabled then check patch existence for retrieval
+         if [[ -n $MAR_OLD_FORMAT ]]; then
+           if $MBSDIFF_HOOK -g "$olddir/$f" "$newdir/$f" "$workdir/$f.patch.bz2"; then
+             verbose_notice "file \"$f\" found in funsize, diffing skipped"
+           else
+             # if not found already - compute it and cache it for future use
+@@ -237,17 +237,17 @@ for ((i=0; $i<$num_oldfiles; i=$i+1)); d
+             $MBSDIFF_HOOK -u "$olddir/$f" "$newdir/$f" "$workdir/$f.patch.bz2"
+           fi
+         else
+           if $MBSDIFF_HOOK -g "$olddir/$f" "$newdir/$f" "$workdir/$f.patch.xz"; then
+             verbose_notice "file \"$f\" found in funsize, diffing skipped"
+           else
+             # if not found already - compute it and cache it for future use
+             $MBSDIFF "$olddir/$f" "$newdir/$f" "$workdir/$f.patch"
+-            $XZ --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force "$workdir/$f.patch"
++            $XZ --compress --lzma2 --format=xz --check=crc64 --force "$workdir/$f.patch"
+             $MBSDIFF_HOOK -u "$olddir/$f" "$newdir/$f" "$workdir/$f.patch.xz"
+           fi
+         fi
+       fi
+       if [[ -n $MAR_OLD_FORMAT ]]; then
+         $BZIP2 -cz9 "$newdir/$f" > "$workdir/$f"
+       else
+         $XZ --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force --stdout "$newdir/$f" > "$workdir/$f"

+ 642 - 0
mozilla-release/patches/1643625-79a1.patch

@@ -0,0 +1,642 @@
+# HG changeset patch
+# User Simon Fraser <sfraser@mozilla.com>
+# Date 1591914190 0
+# Node ID 325d0a84cf461865d509b5aa0dd9a03e0dfa0fd7
+# Parent  fbc2bd478088d38532afadc47b6ee910b20f04e7
+Bug 1643625 Clear up references to MAR_OLD_FORMAT in packaging tools r=nthomas
+
+I think we don't need these checks any more.
+
+Differential Revision: https://phabricator.services.mozilla.com/D78480
+
+diff --git a/python/mozbuild/mozbuild/mach_commands.py b/python/mozbuild/mozbuild/mach_commands.py
+--- a/python/mozbuild/mozbuild/mach_commands.py
++++ b/python/mozbuild/mozbuild/mach_commands.py
+@@ -1159,31 +1159,27 @@ class Repackage(MachCommandBase):
+     @SubCommand('repackage', 'mar',
+                 description='Repackage into complete MAR file')
+     @CommandArgument('--input', '-i', type=str, required=True,
+                      help='Input filename')
+     @CommandArgument('--mar', type=str, required=True,
+                      help='Mar binary path')
+     @CommandArgument('--output', '-o', type=str, required=True,
+                      help='Output filename')
+-    @CommandArgument('--format', type=str, default='lzma',
+-                     choices=('lzma', 'bz2'),
+-                     help='Mar format')
+     @CommandArgument('--arch', type=str, required=True,
+                      help='The archtecture you are building.')
+     @CommandArgument('--mar-channel-id', type=str,
+                      help='Mar channel id')
+-    def repackage_mar(self, input, mar, output, format, arch, mar_channel_id):
++    def repackage_mar(self, input, mar, output, arch, mar_channel_id):
+         from mozbuild.repackaging.mar import repackage_mar
+         repackage_mar(
+             self.topsrcdir,
+             input,
+             mar,
+             output,
+-            format,
+             arch=arch,
+             mar_channel_id=mar_channel_id,
+         )
+ 
+ 
+ @CommandProvider
+ class CreateMachEnvironment(MachCommandBase):
+     """Create the mach virtualenvs."""
+diff --git a/python/mozbuild/mozbuild/repackaging/mar.py b/python/mozbuild/mozbuild/repackaging/mar.py
+--- a/python/mozbuild/mozbuild/repackaging/mar.py
++++ b/python/mozbuild/mozbuild/repackaging/mar.py
+@@ -22,17 +22,17 @@ from mozbuild.util import (
+ _BCJ_OPTIONS = {
+     'x86': ['--x86'],
+     'x86_64': ['--x86'],
+     'aarch64': [],
+ }
+ 
+ 
+ def repackage_mar(
+-    topsrcdir, package, mar, output, mar_format="lzma", arch=None, mar_channel_id=None
++    topsrcdir, package, mar, output, arch=None, mar_channel_id=None
+ ):
+     if not zipfile.is_zipfile(package) and not tarfile.is_tarfile(package):
+         raise Exception("Package file %s is not a valid .zip or .tar file." % package)
+     if arch and arch not in _BCJ_OPTIONS:
+         raise Exception("Unknown architecture {}, available architectures: {}".format(
+             arch, list(_BCJ_OPTIONS.keys())))
+ 
+     ensureParentDir(output)
+@@ -61,18 +61,16 @@ def repackage_mar(
+ 
+         make_full_update = mozpath.join(topsrcdir, 'tools/update-packaging/make_full_update.sh')
+ 
+         env = os.environ.copy()
+         env['MOZ_PRODUCT_VERSION'] = get_application_ini_value(tmpdir, 'App', 'Version')
+         env['MAR'] = mozpath.normpath(mar)
+         if arch:
+             env['BCJ_OPTIONS'] = ' '.join(_BCJ_OPTIONS[arch])
+-        if mar_format == 'bz2':
+-            env['MAR_OLD_FORMAT'] = '1'
+         if mar_channel_id:
+             env['MAR_CHANNEL_ID'] = mar_channel_id
+         # The Windows build systems have xz installed but it isn't in the path
+         # like it is on Linux and Mac OS X so just use the XZ env var so the mar
+         # generation scripts can find it.
+         xz_path = mozpath.join(topsrcdir, 'xz/xz.exe')
+         if os.path.exists(xz_path):
+             env['XZ'] = mozpath.normpath(xz_path)
+diff --git a/tools/update-packaging/change_mar_compression.pl b/tools/update-packaging/change_mar_compression.pl
+deleted file mode 100644
+--- a/tools/update-packaging/change_mar_compression.pl
++++ /dev/null
+@@ -1,208 +0,0 @@
+-#!/usr/bin/perl -w
+-# 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 extracts a mar file, changes the compression of the files contained
+-# by the mar file either from bzip2 to lzma or lzma to bzip2, and then recreates
+-# the mar file. The script determines whether the files are compressed with
+-# bzip2 or lzma to determine what compression should be used. The permissions
+-# of the files will be retained as long as the script is run on a system such
+-# as Linux or Mac OS X but not on Windows. The mar file will be created with the
+-# same MAR channel and Product version information as the original mar file.
+-# If a mar signature is required the converted mar files will need to be
+-# re-signed afterwards.
+-# Author: Robert Strong
+-#
+-
+-# -----------------------------------------------------------------------------
+-# By default just assume that these tools exist in our path
+-
+-use Getopt::Std;
+-use Cwd 'abs_path';
+-use File::Basename;
+-
+-$|++;
+-
+-my ($MAR, $XZ, $BZIP2, $MAR_OLD_FORMAT, $FILES, $CHANNEL, $VERSION, $REPLACE, $archive, $tmparchive, @marentries, @marfiles);
+-
+-if (defined($ENV{"MAR"})) {
+-    $MAR = $ENV{"MAR"};
+-}
+-else {
+-    $MAR = "mar";
+-}
+-
+-if (defined($ENV{"BZIP2"})) {
+-    $BZIP2 = $ENV{"BZIP2"};
+-}
+-else {
+-    $BZIP2 = "bzip2";
+-}
+-
+-if (defined($ENV{"XZ"})) {
+-    $XZ = $ENV{"XZ"};
+-}
+-else {
+-    $XZ = "xz";
+-}
+-
+-sub print_usage
+-{
+-    print "Usage: change_mar_compression.pl [OPTIONS] ARCHIVE\n";
+-	print "\n";
+-    print "The ARCHIVE will be recreated using either bzip2 for mar file contents that\n";
+-	print "are compressed with lzma or lzma for mar file contents that are compressed\n";
+-	print "with bzip2. The new mar file that is created will not be signed but all other\n";
+-	print "attributes that should be retained will be retained.\n";
+-	print "\n";
+-    print "Options:\n";
+-    print "  -h show this help text\n";
+-    print "  -r replace the original mar file with the new mar file\n";
+-}
+-
+-my %opts;
+-getopts("hr", \%opts);
+-
+-if (defined($opts{'h'}) || scalar(@ARGV) != 1) {
+-    print_usage();
+-    exit 1;
+-}
+-
+-if ($opts{'r'}) {
+-    $REPLACE = 1;
+-}
+-
+-$archive = $ARGV[0];
+-@marentries = `"$MAR" -T "$archive"`;
+-$? && die("Couldn't run \"$MAR\" -t");
+-
+-system("$MAR -x \"$archive\"") == 0 ||
+-  die "Couldn't run $MAR -x";
+-
+-open(my $testfilename, "updatev3.manifest") or die $!;
+-binmode($testfilename);
+-read($testfilename, my $bytes, 3);
+-if ($bytes eq "BZh") {
+-    $MAR_OLD_TO_NEW = 1;
+-    print "Converting mar file from bzip2 to lzma compression\n";
+-} else {
+-    undef $MAR_OLD_TO_NEW;
+-    print "Converting mar file from lzma to bzip2 compression\n";
+-}
+-close $testfilename;
+-
+-print "\n";
+-
+-# The channel is the 4th line of the output
+-shift @marentries;
+-shift @marentries;
+-shift @marentries;
+-$CHANNEL = substr($marentries[0], 24, -1);
+-print "MAR channel name: " . $CHANNEL . "\n";
+-
+-# The version is the 5th line of the output
+-shift @marentries;
+-$VERSION = substr($marentries[0], 23, -1);
+-print "Product version: " . $VERSION . "\n";
+-
+-# The file entries start on the 8th line of the output
+-shift @marentries;
+-shift @marentries;
+-shift @marentries;
+-
+-print "\n";
+-# Decompress the extracted files
+-foreach (@marentries) {
+-    tr/\n\r//d;
+-    my @splits = split(/\t/,$_);
+-    my $file = $splits[2];
+-
+-    print "Decompressing: " . $file . "\n";
+-    if ($MAR_OLD_TO_NEW) {
+-        system("mv \"$file\" \"$file.bz2\"") == 0 ||
+-          print "\n" && die "Couldn't mv \"$file\"";
+-        system("\"$BZIP2\" -d \"$file.bz2\"") == 0 ||
+-          print "\n" && die "Couldn't decompress \"$file\"";
+-    }
+-    else {
+-        system("mv \"$file\" \"$file.xz\"") == 0 ||
+-          print "\n" && die "Couldn't mv \"$file\"";
+-        system("\"$XZ\" -d \"$file.xz\"") == 0 ||
+-          print "\n" && die "Couldn't decompress \"$file\"";
+-    }
+-}
+-print "All files decompressed\n";
+-
+-print "\n";
+-# Compress the files in the requested format
+-$FILES = "";
+-foreach (@marentries) {
+-    tr/\n\r//d;
+-    my @splits = split(/\t/,$_);
+-    my $mod = $splits[1];
+-    my $file = $splits[2];
+-
+-    print "Compressing: " . $file . "\n";
+-    if ($MAR_OLD_TO_NEW) {
+-        system("\"$XZ\" --compress --x86 --lzma2 --format=xz --check=crc64 --force --stdout \"$file\" > \"$file.xz\"") == 0 ||
+-          die "Couldn't compress \"$file\"";
+-        system("mv \"$file.xz\" \"$file\"") == 0 ||
+-          die "Couldn't mv \"$file.xz\"";
+-    }
+-    else {
+-        system("\"$BZIP2\" -z9 \"$file\"") == 0 ||
+-          die "Couldn't compress \"$file\"";
+-        system("mv \"$file.bz2\" \"$file\"") == 0 ||
+-          die "Couldn't mv \"$file.bz2\"";
+-    }
+-    $FILES = $FILES . "\"$file\" ";
+-    chmod oct($mod), $file;
+-}
+-print "All files compressed\n";
+-
+-my $filesuffix = ".bz";
+-if ($MAR_OLD_TO_NEW) {
+-    $filesuffix = ".xz";
+-}
+-$tmparchive = $archive . $filesuffix;
+-
+-system("$MAR -H $CHANNEL -V $VERSION -c \"$tmparchive\" $FILES") == 0 ||
+-  die "Couldn't run $MAR -c";
+-
+-if ($REPLACE) {
+-    print "\n";
+-    print "Replacing mar file with the converted mar file\n";
+-    unlink $archive;
+-    system("mv \"$tmparchive\" \"$archive\"") == 0 ||
+-      die "Couldn't mv \"$tmparchive\"";
+-}
+-
+-print "\n";
+-print "Removing extracted files\n";
+-foreach (@marentries) {
+-    tr/\n\r//d;
+-    my @splits = split(/\t/,$_);
+-    my $file = $splits[2];
+-
+-    unlink $file;
+-    my $dirpath = $file;
+-    while (1) {
+-        if (index($dirpath, '/') < 0) {
+-            last;
+-        }
+-        $dirpath = substr($dirpath, 0, rindex($dirpath, '/'));
+-        rmdir($dirpath);
+-        if (-d $dirpath) {
+-            last;
+-        }
+-    }
+-}
+-
+-print "\n";
+-if ($MAR_OLD_TO_NEW) {
+-    print "Finished converting mar file from bzip2 to lzma compression\n";
+-} else {
+-    print "Finished converting mar file from lzma to bzip2 compression\n";
+-}
+diff --git a/tools/update-packaging/common.sh b/tools/update-packaging/common.sh
+--- a/tools/update-packaging/common.sh
++++ b/tools/update-packaging/common.sh
+@@ -9,39 +9,34 @@
+ #
+ 
+ # -----------------------------------------------------------------------------
+ QUIET=0
+ 
+ # By default just assume that these tools exist on our path
+ MAR=${MAR:-mar}
+ MBSDIFF=${MBSDIFF:-mbsdiff}
+-if [[ -z "${MAR_OLD_FORMAT}" ]]; then
+-  XZ=${XZ:-xz}
++XZ=${XZ:-xz}
++$XZ --version > /dev/null 2>&1
++if [ $? -ne 0 ]; then
++  # If $XZ is not set and not found on the path then this is probably
++  # running on a windows buildbot. Some of the Windows build systems have
++  # xz.exe in topsrcdir/xz/. Look in the places this would be in both a
++  # mozilla-central and comm-central build.
++  XZ="$(dirname "$(dirname "$(dirname "$0")")")/xz/xz.exe"
+   $XZ --version > /dev/null 2>&1
+   if [ $? -ne 0 ]; then
+-    # If $XZ is not set and not found on the path then this is probably
+-    # running on a windows buildbot. Some of the Windows build systems have
+-    # xz.exe in topsrcdir/xz/. Look in the places this would be in both a
+-    # mozilla-central and comm-central build.
+-    XZ="$(dirname "$(dirname "$(dirname "$0")")")/xz/xz.exe"
++    XZ="$(dirname "$(dirname "$(dirname "$(dirname "$0")")")")/xz/xz.exe"
+     $XZ --version > /dev/null 2>&1
+     if [ $? -ne 0 ]; then
+-      XZ="$(dirname "$(dirname "$(dirname "$(dirname "$0")")")")/xz/xz.exe"
+-      $XZ --version > /dev/null 2>&1
+-      if [ $? -ne 0 ]; then
+-        echo "xz was not found on this system!"
+-        echo "exiting"
+-        exit 1
+-      fi
++      echo "xz was not found on this system!"
++      echo "exiting"
++      exit 1
+     fi
+   fi
+-else
+-  MAR_OLD_FORMAT=1
+-  BZIP2=${BZIP2:-bzip2}
+ fi
+ 
+ # -----------------------------------------------------------------------------
+ # Helper routines
+ 
+ notice() {
+   echo "$*" 1>&2
+ }
+diff --git a/tools/update-packaging/make_full_update.sh b/tools/update-packaging/make_full_update.sh
+--- a/tools/update-packaging/make_full_update.sh
++++ b/tools/update-packaging/make_full_update.sh
+@@ -96,38 +96,29 @@ for ((i=0; $i<$num_files; i=$i+1)); do
+       make_add_instruction "$f" "$updatemanifestv2" "" 1
+     fi
+   else
+     make_add_instruction "$f" "$updatemanifestv2" "$updatemanifestv3"
+   fi
+ 
+   dir=$(dirname "$f")
+   mkdir -p "$workdir/$dir"
+-  if [[ -n $MAR_OLD_FORMAT ]]; then
+-    $BZIP2 -cz9 "$targetdir/$f" > "$workdir/$f"
+-  else
+-    $XZ --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force --stdout "$targetdir/$f" > "$workdir/$f"
+-  fi
++  $XZ --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force --stdout "$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"
+ 
+-if [[ -n $MAR_OLD_FORMAT ]]; then
+-  $BZIP2 -z9 "$updatemanifestv2" && mv -f "$updatemanifestv2.bz2" "$updatemanifestv2"
+-  $BZIP2 -z9 "$updatemanifestv3" && mv -f "$updatemanifestv3.bz2" "$updatemanifestv3"
+-else
+-  $XZ --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force "$updatemanifestv2" && mv -f "$updatemanifestv2.xz" "$updatemanifestv2"
+-  $XZ --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force "$updatemanifestv3" && mv -f "$updatemanifestv3.xz" "$updatemanifestv3"
+-fi
++$XZ --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force "$updatemanifestv2" && mv -f "$updatemanifestv2.xz" "$updatemanifestv2"
++$XZ --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force "$updatemanifestv3" && mv -f "$updatemanifestv3.xz" "$updatemanifestv3"
+ 
+ mar_command="$mar_command -C \"$workdir\" -c output.mar"
+ eval "$mar_command $targetfiles"
+ mv -f "$workdir/output.mar" "$archive"
+ 
+ # cleanup
+ rm -fr "$workdir"
+ 
+diff --git a/tools/update-packaging/make_incremental_update.sh b/tools/update-packaging/make_incremental_update.sh
+--- a/tools/update-packaging/make_incremental_update.sh
++++ b/tools/update-packaging/make_incremental_update.sh
+@@ -169,35 +169,27 @@ for ((i=0; $i<$num_oldfiles; i=$i+1)); d
+   f="${oldfiles[$i]}"
+ 
+   # If this file exists in the new directory as well, then check if it differs.
+   if [ -f "$newdir/$f" ]; then
+ 
+     if check_for_add_if_not_update "$f"; then
+       # The full workdir may not exist yet, so create it if necessary.
+       mkdir -p `dirname "$workdir/$f"`
+-      if [[ -n $MAR_OLD_FORMAT ]]; then
+-        $BZIP2 -cz9 "$newdir/$f" > "$workdir/$f"
+-      else
+-        $XZ --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force --stdout "$newdir/$f" > "$workdir/$f"
+-      fi
++      $XZ --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force --stdout "$newdir/$f" > "$workdir/$f"
+       copy_perm "$newdir/$f" "$workdir/$f"
+       make_add_if_not_instruction "$f" "$updatemanifestv3"
+       archivefiles="$archivefiles \"$f\""
+       continue 1
+     fi
+ 
+     if check_for_forced_update "$requested_forced_updates" "$f"; then
+       # The full workdir may not exist yet, so create it if necessary.
+       mkdir -p `dirname "$workdir/$f"`
+-      if [[ -n $MAR_OLD_FORMAT ]]; then
+-        $BZIP2 -cz9 "$newdir/$f" > "$workdir/$f"
+-      else
+-        $XZ --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force --stdout "$newdir/$f" > "$workdir/$f"
+-      fi
++      $XZ --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force --stdout "$newdir/$f" > "$workdir/$f"
+       copy_perm "$newdir/$f" "$workdir/$f"
+       make_add_instruction "$f" "$updatemanifestv2" "$updatemanifestv3" 1
+       archivefiles="$archivefiles \"$f\""
+       continue 1
+     fi
+ 
+     if ! diff "$olddir/$f" "$newdir/$f" > /dev/null; then
+       # Compute both the compressed binary diff and the compressed file, and
+@@ -215,54 +207,31 @@ for ((i=0; $i<$num_oldfiles; i=$i+1)); d
+       # myscript.sh -A SERVER-URL [-c LOCAL-CACHE-DIR-PATH] [-g] [-u] \
+       #   PATH-FROM-URL PATH-TO-URL PATH-PATCH SERVER-URL
+       #
+       # Note: patches are bzipped or xz stashed in funsize to gain more speed
+ 
+       # if service is not enabled then default to old behavior
+       if [ -z "$MBSDIFF_HOOK" ]; then
+         $MBSDIFF "$olddir/$f" "$newdir/$f" "$workdir/$f.patch"
+-        if [[ -n $MAR_OLD_FORMAT ]]; then
+-          $BZIP2 -z9 "$workdir/$f.patch"
+-        else
+-          $XZ --compress --lzma2 --format=xz --check=crc64 --force "$workdir/$f.patch"
+-        fi
++        $XZ --compress --lzma2 --format=xz --check=crc64 --force "$workdir/$f.patch"
+       else
+         # if service enabled then check patch existence for retrieval
+-        if [[ -n $MAR_OLD_FORMAT ]]; then
+-          if $MBSDIFF_HOOK -g "$olddir/$f" "$newdir/$f" "$workdir/$f.patch.bz2"; then
+-            verbose_notice "file \"$f\" found in funsize, diffing skipped"
+-          else
+-            # if not found already - compute it and cache it for future use
+-            $MBSDIFF "$olddir/$f" "$newdir/$f" "$workdir/$f.patch"
+-            $BZIP2 -z9 "$workdir/$f.patch"
+-            $MBSDIFF_HOOK -u "$olddir/$f" "$newdir/$f" "$workdir/$f.patch.bz2"
+-          fi
++        if $MBSDIFF_HOOK -g "$olddir/$f" "$newdir/$f" "$workdir/$f.patch.xz"; then
++          verbose_notice "file \"$f\" found in funsize, diffing skipped"
+         else
+-          if $MBSDIFF_HOOK -g "$olddir/$f" "$newdir/$f" "$workdir/$f.patch.xz"; then
+-            verbose_notice "file \"$f\" found in funsize, diffing skipped"
+-          else
+-            # if not found already - compute it and cache it for future use
+-            $MBSDIFF "$olddir/$f" "$newdir/$f" "$workdir/$f.patch"
+-            $XZ --compress --lzma2 --format=xz --check=crc64 --force "$workdir/$f.patch"
+-            $MBSDIFF_HOOK -u "$olddir/$f" "$newdir/$f" "$workdir/$f.patch.xz"
+-          fi
++          # if not found already - compute it and cache it for future use
++          $MBSDIFF "$olddir/$f" "$newdir/$f" "$workdir/$f.patch"
++          $XZ --compress --lzma2 --format=xz --check=crc64 --force "$workdir/$f.patch"
++          $MBSDIFF_HOOK -u "$olddir/$f" "$newdir/$f" "$workdir/$f.patch.xz"
+         fi
+       fi
+-      if [[ -n $MAR_OLD_FORMAT ]]; then
+-        $BZIP2 -cz9 "$newdir/$f" > "$workdir/$f"
+-      else
+-        $XZ --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force --stdout "$newdir/$f" > "$workdir/$f"
+-      fi
++      $XZ --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force --stdout "$newdir/$f" > "$workdir/$f"
+       copy_perm "$newdir/$f" "$workdir/$f"
+-      if [[ -n $MAR_OLD_FORMAT ]]; then
+-        patchfile="$workdir/$f.patch.bz2"
+-      else
+-        patchfile="$workdir/$f.patch.xz"
+-      fi
++      patchfile="$workdir/$f.patch.xz"
+       patchsize=$(get_file_size "$patchfile")
+       fullsize=$(get_file_size "$workdir/$f")
+ 
+       if [ $patchsize -lt $fullsize ]; then
+         make_patch_instruction "$f" "$updatemanifestv2" "$updatemanifestv3"
+         mv -f "$patchfile" "$workdir/$f.patch"
+         rm -f "$workdir/$f"
+         archivefiles="$archivefiles \"$f.patch\""
+@@ -293,21 +262,17 @@ for ((i=0; $i<$num_newfiles; i=$i+1)); d
+     if [ "$f" = "${oldfiles[j]}" ]; then
+       continue 2
+     fi
+   done
+ 
+   dir=$(dirname "$workdir/$f")
+   mkdir -p "$dir"
+ 
+-  if [[ -n $MAR_OLD_FORMAT ]]; then
+-    $BZIP2 -cz9 "$newdir/$f" > "$workdir/$f"
+-  else
+-    $XZ --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force --stdout "$newdir/$f" > "$workdir/$f"
+-  fi
++  $XZ --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force --stdout "$newdir/$f" > "$workdir/$f"
+   copy_perm "$newdir/$f" "$workdir/$f"
+ 
+   if check_for_add_if_not_update "$f"; then
+     make_add_if_not_instruction "$f" "$updatemanifestv3"
+   else
+     make_add_instruction "$f" "$updatemanifestv2" "$updatemanifestv3"
+   fi
+ 
+@@ -338,23 +303,18 @@ for ((i=0; $i<$num_olddirs; i=$i+1)); do
+   # If this dir doesn't exist in the new directory remove it.
+   if [ ! -d "$newdir/$f" ]; then
+     verbose_notice "      rmdir $f/"
+     echo "rmdir \"$f/\"" >> $updatemanifestv2
+     echo "rmdir \"$f/\"" >> $updatemanifestv3
+   fi
+ done
+ 
+-if [[ -n $MAR_OLD_FORMAT ]]; then
+-  $BZIP2 -z9 "$updatemanifestv2" && mv -f "$updatemanifestv2.bz2" "$updatemanifestv2"
+-  $BZIP2 -z9 "$updatemanifestv3" && mv -f "$updatemanifestv3.bz2" "$updatemanifestv3"
+-else
+-  $XZ --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force "$updatemanifestv2" && mv -f "$updatemanifestv2.xz" "$updatemanifestv2"
+-  $XZ --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force "$updatemanifestv3" && mv -f "$updatemanifestv3.xz" "$updatemanifestv3"
+-fi
++$XZ --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force "$updatemanifestv2" && mv -f "$updatemanifestv2.xz" "$updatemanifestv2"
++$XZ --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force "$updatemanifestv3" && mv -f "$updatemanifestv3.xz" "$updatemanifestv3"
+ 
+ mar_command="$mar_command -C \"$workdir\" -c output.mar"
+ eval "$mar_command $archivefiles"
+ mv -f "$workdir/output.mar" "$archive"
+ 
+ # cleanup
+ rm -fr "$workdir"
+ 
+diff --git a/tools/update-packaging/unwrap_full_update.pl b/tools/update-packaging/unwrap_full_update.pl
+--- a/tools/update-packaging/unwrap_full_update.pl
++++ b/tools/update-packaging/unwrap_full_update.pl
+@@ -8,32 +8,25 @@
+ # Author: Benjamin Smedberg
+ #
+ 
+ # -----------------------------------------------------------------------------
+ # By default just assume that these tools exist on our path
+ 
+ use Getopt::Std;
+ 
+-my ($MAR, $XZ, $BZIP2, $MAR_OLD_FORMAT, $archive, @marentries, @marfiles);
++my ($MAR, $XZ, $archive, @marentries, @marfiles);
+ 
+ if (defined($ENV{"MAR"})) {
+     $MAR = $ENV{"MAR"};
+ }
+ else {
+     $MAR = "mar";
+ }
+ 
+-if (defined($ENV{"BZIP2"})) {
+-    $BZIP2 = $ENV{"BZIP2"};
+-}
+-else {
+-    $BZIP2 = "bzip2";
+-}
+-
+ if (defined($ENV{"XZ"})) {
+     $XZ = $ENV{"XZ"};
+ }
+ else {
+     if (system("xz --version > /dev/null 2>&1") != 0) {
+         # Some of the Windows build systems have xz.exe in topsrcdir/xz/.
+         my $xzwinpath = __FILE__;
+         $xzwinpath = substr($xzwinpath, 0, rindex($xzwinpath, '/'));
+@@ -79,45 +72,24 @@ if (defined($opts{'h'}) || scalar(@ARGV)
+ 
+ $archive = $ARGV[0];
+ @marentries = `"$MAR" -t "$archive"`;
+ $? && die("Couldn't run \"$MAR\" -t");
+ 
+ system($MAR, "-x", $archive) == 0 ||
+   die "Couldn't run $MAR -x";
+ 
+-# Try to determine if the mar file contains bzip2 compressed files and if not
+-# assume that the mar file contains lzma compressed files. The updatev3.manifest
+-# file is checked since a valid mar file must have this file in the root path.
+-open(my $testfilename, "updatev3.manifest") or die $!;
+-binmode($testfilename);
+-read($testfilename, my $bytes, 3);
+-if ($bytes eq "BZh") {
+-    $MAR_OLD_FORMAT = 1;
+-} else {
+-    undef $MAR_OLD_FORMAT;
+-}
+-close $testfilename;
+-
+ shift @marentries;
+ 
+ foreach (@marentries) {
+     tr/\n\r//d;
+     my @splits = split(/\t/,$_);
+     my $file = $splits[2];
+ 
+     print "Decompressing: " . $file . "\n";
+-    if ($MAR_OLD_FORMAT) {
+-      system("mv", $file, "$file.bz2") == 0 ||
+-        die "Couldn't mv \"$file\"";
+-      system($BZIP2, "-d", "$file.bz2") == 0 ||
+-        die "Couldn't decompress \"$file\"";
+-    }
+-    else {
+-      system("mv", $file, "$file.xz") == 0 ||
+-        die "Couldn't mv \"$file\"";
+-      system($XZ, "-d", "$file.xz") == 0 ||
+-        die "Couldn't decompress \"$file\"";
+-    }
++    system("mv", $file, "$file.xz") == 0 ||
++      die "Couldn't mv \"$file\"";
++    system($XZ, "-d", "$file.xz") == 0 ||
++      die "Couldn't decompress \"$file\"";
+ }
+ 
+ print "Finished\n";
+ 

+ 209 - 0
mozilla-release/patches/1643810-79a1.patch

@@ -0,0 +1,209 @@
+# HG changeset patch
+# User Chris AtLee <catlee@mozilla.com>
+# Date 1592315927 0
+# Node ID a6db77be78182925b6b5d9202b0b76320eef3813
+# Parent  7a730178ebb0b81126caf2436a4840c906c0b30a
+Bug 1643810: Use -T1 -7e for update generation r=sfraser
+
+Differential Revision: https://phabricator.services.mozilla.com/D78808
+
+diff --git a/tools/update-packaging/common.sh b/tools/update-packaging/common.sh
+--- a/tools/update-packaging/common.sh
++++ b/tools/update-packaging/common.sh
+@@ -28,16 +28,18 @@ if [ $? -ne 0 ]; then
+     $XZ --version > /dev/null 2>&1
+     if [ $? -ne 0 ]; then
+       echo "xz was not found on this system!"
+       echo "exiting"
+       exit 1
+     fi
+   fi
+ fi
++# Ensure that we're always using the right compression settings
++export XZ_OPT="-T1 -7e"
+ 
+ # -----------------------------------------------------------------------------
+ # Helper routines
+ 
+ notice() {
+   echo "$*" 1>&2
+ }
+ 
+diff --git a/tools/update-packaging/make_full_update.sh b/tools/update-packaging/make_full_update.sh
+--- a/tools/update-packaging/make_full_update.sh
++++ b/tools/update-packaging/make_full_update.sh
+@@ -96,29 +96,29 @@ for ((i=0; $i<$num_files; i=$i+1)); do
+       make_add_instruction "$f" "$updatemanifestv2" "" 1
+     fi
+   else
+     make_add_instruction "$f" "$updatemanifestv2" "$updatemanifestv3"
+   fi
+ 
+   dir=$(dirname "$f")
+   mkdir -p "$workdir/$dir"
+-  $XZ --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force --stdout "$targetdir/$f" > "$workdir/$f"
++  $XZ $XZ_OPT --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force --stdout "$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"
+ 
+-$XZ --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force "$updatemanifestv2" && mv -f "$updatemanifestv2.xz" "$updatemanifestv2"
+-$XZ --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force "$updatemanifestv3" && mv -f "$updatemanifestv3.xz" "$updatemanifestv3"
++$XZ $XZ_OPT --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force "$updatemanifestv2" && mv -f "$updatemanifestv2.xz" "$updatemanifestv2"
++$XZ $XZ_OPT --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force "$updatemanifestv3" && mv -f "$updatemanifestv3.xz" "$updatemanifestv3"
+ 
+ mar_command="$mar_command -C \"$workdir\" -c output.mar"
+ eval "$mar_command $targetfiles"
+ mv -f "$workdir/output.mar" "$archive"
+ 
+ # cleanup
+ rm -fr "$workdir"
+ 
+diff --git a/tools/update-packaging/make_incremental_update.sh b/tools/update-packaging/make_incremental_update.sh
+--- a/tools/update-packaging/make_incremental_update.sh
++++ b/tools/update-packaging/make_incremental_update.sh
+@@ -169,27 +169,27 @@ for ((i=0; $i<$num_oldfiles; i=$i+1)); d
+   f="${oldfiles[$i]}"
+ 
+   # If this file exists in the new directory as well, then check if it differs.
+   if [ -f "$newdir/$f" ]; then
+ 
+     if check_for_add_if_not_update "$f"; then
+       # The full workdir may not exist yet, so create it if necessary.
+       mkdir -p `dirname "$workdir/$f"`
+-      $XZ --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force --stdout "$newdir/$f" > "$workdir/$f"
++      $XZ $XZ_OPT --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force --stdout "$newdir/$f" > "$workdir/$f"
+       copy_perm "$newdir/$f" "$workdir/$f"
+       make_add_if_not_instruction "$f" "$updatemanifestv3"
+       archivefiles="$archivefiles \"$f\""
+       continue 1
+     fi
+ 
+     if check_for_forced_update "$requested_forced_updates" "$f"; then
+       # The full workdir may not exist yet, so create it if necessary.
+       mkdir -p `dirname "$workdir/$f"`
+-      $XZ --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force --stdout "$newdir/$f" > "$workdir/$f"
++      $XZ $XZ_OPT --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force --stdout "$newdir/$f" > "$workdir/$f"
+       copy_perm "$newdir/$f" "$workdir/$f"
+       make_add_instruction "$f" "$updatemanifestv2" "$updatemanifestv3" 1
+       archivefiles="$archivefiles \"$f\""
+       continue 1
+     fi
+ 
+     if ! diff "$olddir/$f" "$newdir/$f" > /dev/null; then
+       # Compute both the compressed binary diff and the compressed file, and
+@@ -207,29 +207,29 @@ for ((i=0; $i<$num_oldfiles; i=$i+1)); d
+       # myscript.sh -A SERVER-URL [-c LOCAL-CACHE-DIR-PATH] [-g] [-u] \
+       #   PATH-FROM-URL PATH-TO-URL PATH-PATCH SERVER-URL
+       #
+       # Note: patches are bzipped or xz stashed in funsize to gain more speed
+ 
+       # if service is not enabled then default to old behavior
+       if [ -z "$MBSDIFF_HOOK" ]; then
+         $MBSDIFF "$olddir/$f" "$newdir/$f" "$workdir/$f.patch"
+-        $XZ --compress --lzma2 --format=xz --check=crc64 --force "$workdir/$f.patch"
++        $XZ $XZ_OPT --compress --lzma2 --format=xz --check=crc64 --force "$workdir/$f.patch"
+       else
+         # if service enabled then check patch existence for retrieval
+         if $MBSDIFF_HOOK -g "$olddir/$f" "$newdir/$f" "$workdir/$f.patch.xz"; then
+           verbose_notice "file \"$f\" found in funsize, diffing skipped"
+         else
+           # if not found already - compute it and cache it for future use
+           $MBSDIFF "$olddir/$f" "$newdir/$f" "$workdir/$f.patch"
+-          $XZ --compress --lzma2 --format=xz --check=crc64 --force "$workdir/$f.patch"
++          $XZ $XZ_OPT --compress --lzma2 --format=xz --check=crc64 --force "$workdir/$f.patch"
+           $MBSDIFF_HOOK -u "$olddir/$f" "$newdir/$f" "$workdir/$f.patch.xz"
+         fi
+       fi
+-      $XZ --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force --stdout "$newdir/$f" > "$workdir/$f"
++      $XZ $XZ_OPT --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force --stdout "$newdir/$f" > "$workdir/$f"
+       copy_perm "$newdir/$f" "$workdir/$f"
+       patchfile="$workdir/$f.patch.xz"
+       patchsize=$(get_file_size "$patchfile")
+       fullsize=$(get_file_size "$workdir/$f")
+ 
+       if [ $patchsize -lt $fullsize ]; then
+         make_patch_instruction "$f" "$updatemanifestv2" "$updatemanifestv3"
+         mv -f "$patchfile" "$workdir/$f.patch"
+@@ -262,17 +262,17 @@ for ((i=0; $i<$num_newfiles; i=$i+1)); d
+     if [ "$f" = "${oldfiles[j]}" ]; then
+       continue 2
+     fi
+   done
+ 
+   dir=$(dirname "$workdir/$f")
+   mkdir -p "$dir"
+ 
+-  $XZ --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force --stdout "$newdir/$f" > "$workdir/$f"
++  $XZ $XZ_OPT --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force --stdout "$newdir/$f" > "$workdir/$f"
+   copy_perm "$newdir/$f" "$workdir/$f"
+ 
+   if check_for_add_if_not_update "$f"; then
+     make_add_if_not_instruction "$f" "$updatemanifestv3"
+   else
+     make_add_instruction "$f" "$updatemanifestv2" "$updatemanifestv3"
+   fi
+ 
+@@ -303,18 +303,18 @@ for ((i=0; $i<$num_olddirs; i=$i+1)); do
+   # If this dir doesn't exist in the new directory remove it.
+   if [ ! -d "$newdir/$f" ]; then
+     verbose_notice "      rmdir $f/"
+     echo "rmdir \"$f/\"" >> $updatemanifestv2
+     echo "rmdir \"$f/\"" >> $updatemanifestv3
+   fi
+ done
+ 
+-$XZ --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force "$updatemanifestv2" && mv -f "$updatemanifestv2.xz" "$updatemanifestv2"
+-$XZ --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force "$updatemanifestv3" && mv -f "$updatemanifestv3.xz" "$updatemanifestv3"
++$XZ $XZ_OPT --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force "$updatemanifestv2" && mv -f "$updatemanifestv2.xz" "$updatemanifestv2"
++$XZ $XZ_OPT --compress $BCJ_OPTIONS --lzma2 --format=xz --check=crc64 --force "$updatemanifestv3" && mv -f "$updatemanifestv3.xz" "$updatemanifestv3"
+ 
+ mar_command="$mar_command -C \"$workdir\" -c output.mar"
+ eval "$mar_command $archivefiles"
+ mv -f "$workdir/output.mar" "$archive"
+ 
+ # cleanup
+ rm -fr "$workdir"
+ 
+diff --git a/tools/update-packaging/test/make_full_update.sh b/tools/update-packaging/test/make_full_update.sh
+--- a/tools/update-packaging/test/make_full_update.sh
++++ b/tools/update-packaging/test/make_full_update.sh
+@@ -89,29 +89,29 @@ for ((i=0; $i<$num_files; i=$i+1)); do
+       make_add_instruction "$f" "$updatemanifestv2" "" 1
+     fi
+   else
+     make_add_instruction "$f" "$updatemanifestv2" "$updatemanifestv3"
+   fi
+ 
+   dir=$(dirname "$f")
+   mkdir -p "$workdir/$dir"
+-  $XZ --compress --x86 --lzma2 --format=xz --check=crc64 --force --stdout "$targetdir/$f" > "$workdir/$f"
++  $XZ $XZ_OPT --compress --x86 --lzma2 --format=xz --check=crc64 --force --stdout "$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"
+ 
+-$XZ --compress --x86 --lzma2 --format=xz --check=crc64 --force "$updatemanifestv2" && mv -f "$updatemanifestv2.xz" "$updatemanifestv2"
+-$XZ --compress --x86 --lzma2 --format=xz --check=crc64 --force "$updatemanifestv3" && mv -f "$updatemanifestv3.xz" "$updatemanifestv3"
++$XZ $XZ_OPT --compress --x86 --lzma2 --format=xz --check=crc64 --force "$updatemanifestv2" && mv -f "$updatemanifestv2.xz" "$updatemanifestv2"
++$XZ $XZ_OPT --compress --x86 --lzma2 --format=xz --check=crc64 --force "$updatemanifestv3" && mv -f "$updatemanifestv3.xz" "$updatemanifestv3"
+ 
+ eval "$MAR -C \"$workdir\" -c output.mar $targetfiles"
+ mv -f "$workdir/output.mar" "$archive"
+ 
+ # cleanup
+ rm -fr "$workdir"
+ 
+ notice ""

+ 21 - 0
mozilla-release/patches/series

@@ -7207,13 +7207,18 @@ TOP-NOBUG-nsstyle-prefers-reduced-motion.patch
 TOP-1909714-NSS3904-11514.patch
 TOP-1909714-NSS3904-11514.patch
 1391079-2-57a1.patch
 1391079-2-57a1.patch
 1363897-2-57a1.patch
 1363897-2-57a1.patch
+1389420-57a1.patch
 1401814-58a1.patch
 1401814-58a1.patch
+1403084-58a1.patch
 1392913-58a1.patch
 1392913-58a1.patch
 1406662-1only-59a1.patch
 1406662-1only-59a1.patch
 1414450-59a1.patch
 1414450-59a1.patch
 1404823-59a1.patch
 1404823-59a1.patch
 1427155-59a1.patch
 1427155-59a1.patch
 1426566-3-PARTIAL-59a1.patch
 1426566-3-PARTIAL-59a1.patch
+1426566-4-59a1.patch
+1428936-59a1.patch
+1412962-59a1.patch
 1431477-1-60a1.patch
 1431477-1-60a1.patch
 1431477-2-60a1.patch
 1431477-2-60a1.patch
 1403005-1-60a1.patch
 1403005-1-60a1.patch
@@ -7249,4 +7254,20 @@ TOP-1909714-NSS3904-11514.patch
 1521133-66a1.patch
 1521133-66a1.patch
 1524142-67a1.patch
 1524142-67a1.patch
 1525858-67a1.patch
 1525858-67a1.patch
+1536522-68a1.patch
+1538475-68a1.patch
+1546320-PARTIAL-68a1.patch
+1546322-69a1.patch
+1458385-1-70a1.patch
+1458385-2-70a1.patch
+1577664-70a1.patch
+1577760-71a1.patch
+1632531-1only-PARTIAL-77a1.patch
+1635321-78a1.patch
+1641329-78a1.patch
+1643188-79a1.patch
+1643211-79a1.patch
+1643625-79a1.patch
+1643810-79a1.patch
+1392914-79a1.patch
 TOP-NOBUG-blockquad0-25319.patch
 TOP-NOBUG-blockquad0-25319.patch