Special One-Time SRU Handling request for torbrowser-launcher

Robie Basak robie.basak at ubuntu.com
Wed Apr 19 11:30:04 UTC 2023


On Thu, Apr 06, 2023 at 04:11:23PM -0400, Thomas Ward wrote:
> To cherry pick this would require extensive reverse engineering of the code
> to figure out which pieces apply to the *older* versions of
> torbrowser-launcher.  Unfortunately, since there are no *bugfix* releases of
> torbrowser-launcher upstream and everything is interspersed among
> larger-scale feature changes, this prevents us from easily cherrypicking the
> code.  Essentially, to reverse engineer this patch would take much MUCH more
> time and effort to make functional.

I took a look at what this would take, and got to a minimal patch for
Focal within about an hour (including environment setup) that seems to
work fine. See below.

This needs cleaning up, packaging, attribution, adapting for the other
stable releases, and so on. But as it stands, it seems to me that the
usual approach is the appropriate way to fix this in our stable
releases.

Is there something I'm missing about how this approach is broken? Of
course if there are other bugfixes you want to take from upstream, you
could include them in this SRU in the usual way.

Note that there is no hard reason to cherry-pick. It's perfectly
acceptable to come up with an independent minimal fix, informed but not
directly drawn from upstream changes. SRU policy says this:

> ...the requirements for stable updates are not necessarily the same as
> those in the development release. When preparing future releases, one
> of our goals is to construct the most elegant and maintainable system
> possible, and this often involves fundamental improvements to the
> system's architecture, rearranging packages to avoid bundled copies of
> other software so that we only have to maintain it in one place, and
> so on. However, once we have completed a release, the priority is
> normally to minimise risk caused by changes not explicitly required to
> fix qualifying bugs, and this tends to be well-correlated with
> minimising the size of those changes. As such, the same bug may need
> to be fixed in different ways in stable and development releases.

Here's the minimal patch for Focal, with thanks to the respective
upstream authors:


--- common.py.orig	2023-04-19 12:09:12.723867908 +0100
+++ common.py	2023-04-19 12:09:06.647653367 +0100
@@ -58,6 +58,7 @@
         self.default_mirror = 'https://dist.torproject.org/'
         self.discover_arch_lang()
         self.build_paths()
+        self.torbrowser12_rename_old_tbb()
         for d in self.paths['dirs']:
             self.mkdir(self.paths['dirs'][d])
         self.load_mirrors()
@@ -151,12 +152,12 @@
                 'version_check_url': 'https://aus1.torproject.org/torbrowser/update_3/release/Linux_x86_64-gcc3/x/en-US',
                 'version_check_file': tbb_cache + '/download/release.xml',
                 'tbb': {
-                    'changelog': tbb_local + '/tbb/' + self.architecture + '/tor-browser_' +
-                                 self.language + '/Browser/TorBrowser/Docs/ChangeLog.txt',
+                    'changelog': tbb_local + '/tbb/' + self.architecture + '/tor-browser' +
+                                 '/Browser/TorBrowser/Docs/ChangeLog.txt',
                     'dir': tbb_local + '/tbb/' + self.architecture,
-                    'dir_tbb': tbb_local + '/tbb/' + self.architecture + '/tor-browser_' + self.language,
-                    'start': tbb_local + '/tbb/' + self.architecture + '/tor-browser_' +
-                             self.language + '/start-tor-browser.desktop'
+                    'dir_tbb': tbb_local + '/tbb/' + self.architecture + '/tor-browser',
+                    'start': tbb_local + '/tbb/' + self.architecture + '/tor-browser' +
+                             '/start-tor-browser.desktop'
                 },
             }
 
@@ -165,6 +166,21 @@
             'tor_browser_developers': 'EF6E286DDA85EA2A4BA7DE684E2C6E8793298290'
         }
 
+    # Tor Browser 12.0 no longer has locales. If an old TBB folder exists with locals, rename it to just tor_browser
+    def torbrowser12_rename_old_tbb(self):
+        if not os.path.exists(self.paths["tbb"]["dir"]):
+            return
+        for filename in os.listdir(self.paths["tbb"]["dir"]):
+            abs_filename = os.path.join(self.paths["tbb"]["dir"], filename)
+            if filename.startswith("tor-browser_") and os.path.isdir(abs_filename):
+                os.rename(abs_filename, self.paths["tbb"]["dir_tbb"])
+                print(
+                    _("Renamed {0} to {1}").format(
+                        abs_filename, self.paths["tbb"]["dir_tbb"]
+                    )
+                )
+                break
+
     # create a directory
     @staticmethod
     def mkdir(path):
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/ubuntu-release/attachments/20230419/140162da/attachment.sig>


More information about the Ubuntu-release mailing list