[Pkg-privacy-commits] [torbrowser-launcher] 388/476: prepare for TBB 4 series change to RecommendedTBBVersion (#132)

Ximin Luo infinity0 at moszumanska.debian.org
Sat Aug 22 13:22:02 UTC 2015


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch debian
in repository torbrowser-launcher.

commit c536f50466e3562bdda6f5e4d8362a4fdf09cf4c
Author: Micah Lee <micah at micahflee.com>
Date:   Tue Sep 30 23:10:05 2014 +0000

    prepare for TBB 4 series change to RecommendedTBBVersion (#132)
---
 torbrowser_launcher/launcher.py | 27 ++++++++++++++++-----------
 1 file changed, 16 insertions(+), 11 deletions(-)

diff --git a/torbrowser_launcher/launcher.py b/torbrowser_launcher/launcher.py
index 5172512..619416a 100644
--- a/torbrowser_launcher/launcher.py
+++ b/torbrowser_launcher/launcher.py
@@ -497,6 +497,9 @@ class Launcher:
             versions = json.load(open(self.common.paths['update_check_file']))
             latest = None
 
+            # TODO: after TBB 4.0 is released, refactor this section
+            #       to not filter linux versions (#132)
+
             # filter linux versions
             valid = []
             for version in versions:
@@ -504,18 +507,20 @@ class Launcher:
                     valid.append(str(version))
             valid.sort()
             if len(valid):
-                if len(valid) == 1:
-                    latest = valid.pop()
+                versions = valid
+
+            if len(versions) == 1:
+                latest = versions.pop()
+            else:
+                stable = []
+                # remove alphas/betas
+                for version in versions:
+                    if '-alpha-' not in version and '-beta-' not in version:
+                        stable.append(version)
+                if len(stable):
+                    latest = stable.pop()
                 else:
-                    stable = []
-                    # remove alphas/betas
-                    for version in valid:
-                        if '-alpha-' not in version and '-beta-' not in version:
-                            stable.append(version)
-                    if len(stable):
-                        latest = stable.pop()
-                    else:
-                        latest = valid.pop()
+                    latest = versions.pop()
 
             if latest:
                 self.common.settings['latest_version'] = latest[:-len('-Linux')]

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/torbrowser-launcher.git



More information about the Pkg-privacy-commits mailing list