[Pkg-privacy-commits] [torbrowser-launcher] 03/28: Avoid re-downloading the tbb tarball if it is already present
Ulrike Uhlig
u-guest at moszumanska.debian.org
Sun Jul 10 21:18:16 UTC 2016
This is an automated email from the git hooks/post-receive script.
u-guest pushed a commit to branch debian/sid
in repository torbrowser-launcher.
commit a414f7e061ce4035eaa57e291f5e933a9994af5b
Author: Jon Griffiths <jon_p_griffiths at yahoo.com>
Date: Thu Feb 11 11:02:41 2016 +1300
Avoid re-downloading the tbb tarball if it is already present
If the tarball is present but corrupt it will be re-downloaded.
---
torbrowser_launcher/launcher.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/torbrowser_launcher/launcher.py b/torbrowser_launcher/launcher.py
index a05c4a1..d35357f 100644
--- a/torbrowser_launcher/launcher.py
+++ b/torbrowser_launcher/launcher.py
@@ -55,6 +55,7 @@ class Launcher:
def __init__(self, common, url_list):
self.common = common
self.url_list = url_list
+ self.force_redownload = False
# this is the current version of Tor Browser, which should get updated with every release
self.min_version = '5.5.2'
@@ -260,7 +261,10 @@ class Launcher:
elif task == 'download_tarball':
print _('Downloading'), self.common.paths['tarball_url'].format(self.common.settings['mirror'])
- self.download('tarball', self.common.paths['tarball_url'], self.common.paths['tarball_file'])
+ if not self.force_redownload and os.path.exists(self.common.paths['tarball_file']):
+ self.run_task()
+ else:
+ self.download('tarball', self.common.paths['tarball_url'], self.common.paths['tarball_file'])
elif task == 'verify':
print _('Verifying signature')
@@ -566,6 +570,7 @@ class Launcher:
# start over and download TBB again
def start_over(self):
+ self.force_redownload = True # Overwrite any existing file
self.label.set_text(_("Downloading Tor Browser Bundle over again."))
self.gui_tasks = ['download_tarball', 'verify', 'extract', 'run']
self.gui_task_i = 0
--
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