[tbb-commits] [tor-browser/tor-browser-31.5.0esr-4.5-1] Bug 15406: Only include forced updates if extensions differ.

mikeperry at torproject.org mikeperry at torproject.org
Tue Mar 24 21:54:23 UTC 2015


commit 39e3a2b282d4d89c8c6498162ae155c018d79a68
Author: Kathy Brade <brade at pearlcrescent.com>
Date:   Tue Mar 24 16:34:43 2015 -0400

    Bug 15406: Only include forced updates if extensions differ.
    
    For the NoScript and HTTPS Everywhere extensions, only force files
    to be included in incremental MARs if the extension has changed.
    For NoScript we detect this by comparing the old and new .xpi files.
    For HTTPS Everywhere (which is unpacked) we only check install.rdf;
      our assumption is that the version number will be changed for each
      new release.
---
 tools/update-packaging/make_incremental_update.sh |   41 ++++++++++++++++++---
 1 file changed, 35 insertions(+), 6 deletions(-)

diff --git a/tools/update-packaging/make_incremental_update.sh b/tools/update-packaging/make_incremental_update.sh
index 010101c..10af358 100755
--- a/tools/update-packaging/make_incremental_update.sh
+++ b/tools/update-packaging/make_incremental_update.sh
@@ -69,12 +69,8 @@ if [ $# = 0 ]; then
   exit 1
 fi
 
-# TODO: it would be better to pass these paths via command line options.
-ext_path='TorBrowser/Data/Browser/profile.default/extensions'
-https_everywhere='https-everywhere at eff.org'
-noscript='{73a6fe31-595d-460b-a920-fcc0f8843232}.xpi'
-requested_forced_updates="$ext_path/$https_everywhere/* $ext_path/$noscript"
-directories_to_remove="$ext_path/$https_everywhere"
+requested_forced_updates=""
+directories_to_remove=""
 
 while getopts "hqf:" flag
 do
@@ -109,6 +105,39 @@ updatemanifestv2="$workdir/updatev2.manifest"
 updatemanifestv3="$workdir/updatev3.manifest"
 archivefiles="updatev2.manifest updatev3.manifest"
 
+# If the NoScript or HTTPS Everywhere extensions have changed between
+# releases, add them to the "force updates" list.
+ext_path='TorBrowser/Data/Browser/profile.default/extensions'
+https_everywhere='https-everywhere at eff.org'
+noscript='{73a6fe31-595d-460b-a920-fcc0f8843232}.xpi'
+
+# NoScript is a packed extension, so we simply compare the old and the new
+# .xpi files.
+noscript_path="$ext_path/$noscript"
+diff -a "$olddir/$noscript_path" "$newdir/$noscript_path" > /dev/null
+rc=$?
+if [ $rc -gt 1 ]; then
+  notice "Unexpected exit $rc from $noscript_path diff command"
+  exit 2
+elif [ $rc -eq 1 ]; then
+  requested_forced_updates="$requested_forced_updates $noscript_path"
+fi
+
+# HTTPS Everywhere is an unpacked extension, so we need to determine if any of
+# the unpacked files have changed. Since that is messy, we simply compare the
+# old extension's install.rdf file to the new one.
+https_everywhere_install_rdf="$ext_path/$https_everywhere/install.rdf"
+diff "$olddir/$https_everywhere_install_rdf"     \
+      "$newdir/$https_everywhere_install_rdf" > /dev/null
+rc=$?
+if [ $rc -gt 1 ]; then
+  notice "Unexpected exit $rc from $https_everywhere_install_rdf diff command"
+  exit 2
+elif [ $rc -eq 1 ]; then
+  requested_forced_updates="$requested_forced_updates $ext_path/$https_everywhere/*"
+  directories_to_remove="$directories_to_remove $ext_path/$https_everywhere"
+fi
+
 mkdir -p "$workdir"
 
 # On Mac, the precomplete file added by Bug 386760 will cause OS X to reload the



More information about the tbb-commits mailing list