[Pkg-privacy-commits] [torbrowser-launcher] 301/476: using freedesktop xdg-user-dirs now (fixes #102)
Ximin Luo
infinity0 at moszumanska.debian.org
Sat Aug 22 13:21:48 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 3eaa61d2a5c615feac5f5bb82deb2d593c06f22a
Author: Micah Lee <micah at micahflee.com>
Date: Thu Jul 31 17:22:52 2014 -0700
using freedesktop xdg-user-dirs now (fixes #102)
---
apparmor/usr.bin.torbrowser-launcher | 13 ++++++++----
torbrowser-launcher | 39 ++++++++++++++++++++++--------------
2 files changed, 33 insertions(+), 19 deletions(-)
diff --git a/apparmor/usr.bin.torbrowser-launcher b/apparmor/usr.bin.torbrowser-launcher
index 1aa295e..3475432 100644
--- a/apparmor/usr.bin.torbrowser-launcher
+++ b/apparmor/usr.bin.torbrowser-launcher
@@ -17,10 +17,15 @@
/bin/{dash,grep,ps} rix,
/dev/ r,
/etc/magic r,
- @{HOME}/.torbrowser/ rw,
- @{HOME}/.torbrowser/** mrwk,
- @{HOME}/.torbrowser/gnupg_homedir/* l,
- @{HOME}/.torbrowser/tbb/{i686,x86_64}/tor-browser_*/start-tor-browser ux,
+ @{HOME}/.config/torbrowser/ rw,
+ @{HOME}/.config/torbrowser/** mrwk,
+ @{HOME}/.cache/torbrowser/ rw,
+ @{HOME}/.cache/torbrowser/** mrwk,
+ @{HOME}/.local/share/torbrowser/ rw,
+ @{HOME}/.local/share/torbrowser/** mrwk,
+ @{HOME}/.local/share/torbrowser/gnupg_homedir/* l,
+ @{HOME}/.local/share/torbrowser/tbb/{i686,x86_64}/tor-browser_*/start-tor-browser ux,
+
@{PROC}/ r,
@{PROC}/[0-9]*/{cmdline,mountinfo,stat,status} r,
@{PROC}/[0-9]*/task/** r,
diff --git a/torbrowser-launcher b/torbrowser-launcher
index b6b3120..9683e9f 100755
--- a/torbrowser-launcher
+++ b/torbrowser-launcher
@@ -91,7 +91,8 @@ class TBLCommon:
self.default_mirror = 'https://www.torproject.org/dist/'
self.discover_arch_lang()
self.build_paths()
- self.mkdir(self.paths['data_dir'])
+ for d in self.paths['dirs']:
+ self.mkdir(self.paths['dirs'][d])
self.load_mirrors()
self.load_settings()
self.mkdir(self.paths['download_dir'])
@@ -140,7 +141,10 @@ class TBLCommon:
if not os.access(homedir, os.W_OK):
self.set_gui('error', _("{0} is not writable").format(homedir), [], False)
- tbb_data = '%s/.torbrowser' % homedir
+ tbb_config = '{0}/.config/torbrowser'.format(homedir)
+ tbb_cache = '{0}/.cache/torbrowser'.format(homedir)
+ tbb_local = '{0}/.local/share/torbrowser'.format(homedir)
+ old_tbb_data = '{0}/.torbrowser'.format(homedir)
if tbb_version:
# tarball filename
@@ -152,16 +156,22 @@ class TBLCommon:
# tarball
self.paths['tarball_url'] = '{0}torbrowser/'+tbb_version+'/'+tarball_filename
- self.paths['tarball_file'] = tbb_data+'/download/'+tarball_filename
+ self.paths['tarball_file'] = tbb_cache+'/download/'+tarball_filename
self.paths['tarball_filename'] = tarball_filename
# sig
- self.paths['sha256_file'] = tbb_data+'/download/sha256sums.txt'
- self.paths['sha256_sig_file'] = tbb_data+'/download/sha256sums.txt.asc'
+ self.paths['sha256_file'] = tbb_cache+'/download/sha256sums.txt'
+ self.paths['sha256_sig_file'] = tbb_cache+'/download/sha256sums.txt.asc'
self.paths['sha256_url'] = '{0}torbrowser/'+tbb_version+'/sha256sums.txt'
self.paths['sha256_sig_url'] = '{0}torbrowser/'+tbb_version+'/sha256sums.txt-mikeperry.asc'
else:
self.paths = {
+ 'dirs': {
+ 'config': tbb_config,
+ 'cache': tbb_cache,
+ 'local': tbb_local,
+ },
+ 'old_data_dir': old_tbb_data,
'tbl_bin': '/usr/bin/torbrowser-launcher',
'icon_file': os.path.join(SHARE, 'pixmaps/torbrowser80.xpm'),
'torproject_pem': os.path.join(SHARE, 'torbrowser-launcher/torproject.pem'),
@@ -169,17 +179,16 @@ class TBLCommon:
'mirrors_txt': [os.path.join(SHARE, 'torbrowser-launcher/mirrors.txt'),
'/usr/local/share/torbrowser-launcher/mirrors.txt'],
'modem_sound': os.path.join(SHARE, 'torbrowser-launcher/modem.ogg'),
- 'data_dir': tbb_data,
- 'download_dir': tbb_data+'/download',
- 'gnupg_homedir': tbb_data+'/gnupg_homedir',
- 'settings_file': tbb_data+'/settings',
+ 'download_dir': tbb_cache+'/download',
+ 'gnupg_homedir': tbb_local+'/gnupg_homedir',
+ 'settings_file': tbb_config+'/settings',
'update_check_url': 'https://check.torproject.org/RecommendedTBBVersions',
- 'update_check_file': tbb_data+'/download/RecommendedTBBVersions',
+ 'update_check_file': tbb_cache+'/download/RecommendedTBBVersions',
'tbb': {
- 'dir': tbb_data+'/tbb/'+self.architecture,
- 'start': tbb_data+'/tbb/'+self.architecture+'/tor-browser_'+self.language+'/start-tor-browser',
- 'versions': tbb_data+'/tbb/'+self.architecture+'/tor-browser_'+self.language+'/Docs/sources/versions',
- }
+ 'dir': tbb_local+'/tbb/'+self.architecture,
+ 'start': tbb_local+'/tbb/'+self.architecture+'/tor-browser_'+self.language+'/start-tor-browser',
+ 'versions': tbb_local+'/tbb/'+self.architecture+'/tor-browser_'+self.language+'/Docs/sources/versions',
+ },
}
# create a directory
@@ -248,7 +257,7 @@ class TBLCommon:
# make new tbb folder
self.mkdir(self.paths['tbb']['dir'])
- old_tbb_dir = self.paths['data_dir']+'/tbb/stable/'+self.architecture+'/tor-browser_'+self.language
+ old_tbb_dir = self.paths['old_data_dir']+'/tbb/stable/'+self.architecture+'/tor-browser_'+self.language
new_tbb_dir = self.paths['tbb']['dir']+'/tor-browser_'+self.language
if os.path.isdir(old_tbb_dir):
os.rename(old_tbb_dir, new_tbb_dir)
--
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