diff options
author | Gilles Dartiguelongue <eva@gentoo.org> | 2016-03-05 22:48:13 +0100 |
---|---|---|
committer | Gilles Dartiguelongue <eva@gentoo.org> | 2016-03-05 22:49:55 +0100 |
commit | f7c9bab94abf59e07cfe4811b856434932127942 (patch) | |
tree | 5d1a5a94d9ec8874908a427a58aad89d26362be8 /dev-util/dogtail/files | |
parent | app-misc/rlwrap: Drop old (diff) | |
download | gentoo-f7c9bab94abf59e07cfe4811b856434932127942.tar.gz gentoo-f7c9bab94abf59e07cfe4811b856434932127942.tar.bz2 gentoo-f7c9bab94abf59e07cfe4811b856434932127942.zip |
dev-util/dogtail: version bump to 0.9.9, bug #573388
Package-Manager: portage-2.2.27
Diffstat (limited to 'dev-util/dogtail/files')
-rw-r--r-- | dev-util/dogtail/files/dogtail-0.9.9-gentoo-paths.patch | 64 | ||||
-rw-r--r-- | dev-util/dogtail/files/dogtail-0.9.9-get-user.patch | 43 |
2 files changed, 107 insertions, 0 deletions
diff --git a/dev-util/dogtail/files/dogtail-0.9.9-gentoo-paths.patch b/dev-util/dogtail/files/dogtail-0.9.9-gentoo-paths.patch new file mode 100644 index 000000000000..522249949228 --- /dev/null +++ b/dev-util/dogtail/files/dogtail-0.9.9-gentoo-paths.patch @@ -0,0 +1,64 @@ +From 069a17e22a73ecff686b650ba158a292cc508cb5 Mon Sep 17 00:00:00 2001 +From: Gilles Dartiguelongue <eva@gentoo.org> +Date: Sat, 5 Mar 2016 19:38:08 +0100 +Subject: [PATCH] Load resources from well-known location + +Using __file__ does not work with Gentoo's dev-python/python-exec +wrapping. Better use hard-coded paths. + +Also adds support for prefix. +--- + sniff/sniff | 26 +++++++++----------------- + 1 file changed, 9 insertions(+), 17 deletions(-) + +diff --git a/sniff/sniff b/sniff/sniff +index a83a1c2..ff43f38 100755 +--- a/sniff/sniff ++++ b/sniff/sniff +@@ -47,22 +47,18 @@ class SniffApp(object): + if os.path.exists('sniff.ui'): + self.builder.add_from_file('sniff.ui') + else: +- import os +- path = os.path.abspath( +- os.path.join(__file__, os.path.pardir, os.path.pardir)) +- if path == '/': # in case the path is /bin/sniff +- path = '/usr' +- self.builder.add_from_file(path + '/share/dogtail/glade/sniff.ui') ++ self.builder.add_from_file(os.path.join( ++ @EPREFIX_USR@, ++ 'share/dogtail/glade/sniff.ui') ++ ) + self.app = self.builder.get_object(self.appName) + try: + self.app.set_icon_from_file('../icons/dogtail-head.svg') + except Exception: +- import os +- path = os.path.abspath( +- os.path.join(__file__, os.path.pardir, os.path.pardir)) +- if path is '/': +- path = '/usr' +- self.app.set_icon_from_file(os.path.join(path, 'share/icons/hicolor/scalable/apps/dogtail-head.svg')) ++ self.app.set_icon_from_file(os.path.join( ++ @EPREFIX_USR@, ++ 'share/icons/hicolor/scalable/apps/dogtail-head.svg') ++ ) + self.setUpWidgets() + self.connectSignals() + self.app.show_all() +@@ -650,11 +646,7 @@ def loadIcon(iconName): + pixbuf = GdkPixbuf.Pixbuf.new_from_file('icons/' + iconName) + except GObject.GError: + import os +- path = os.path.abspath( +- os.path.join(__file__, os.path.pardir, os.path.pardir)) +- if path == '/': +- path = '/usr' +- iconName = os.path.join(path, 'share/dogtail/icons/', iconName) ++ iconName = os.path.join(@EPREFIX_USR@, 'share/dogtail/icons/', iconName) + pixbuf = GdkPixbuf.Pixbuf.new_from_file(iconName) + return pixbuf + +-- +2.7.2 + diff --git a/dev-util/dogtail/files/dogtail-0.9.9-get-user.patch b/dev-util/dogtail/files/dogtail-0.9.9-get-user.patch new file mode 100644 index 000000000000..a3f7ef77230d --- /dev/null +++ b/dev-util/dogtail/files/dogtail-0.9.9-get-user.patch @@ -0,0 +1,43 @@ +From 1ee93bf9d0d8a143f5faf9d1310d768d1de4ece4 Mon Sep 17 00:00:00 2001 +From: Gilles Dartiguelongue <eva@gentoo.org> +Date: Sat, 5 Mar 2016 20:32:17 +0100 +Subject: [PATCH] Do not use USER as it can be unset. + +Use LOGNAME first as recommended by python documentation, then try alternatives. + +Also, use tempfile to respect environment variables changing tmpdir. + +Upstream: https://fedorahosted.org/dogtail/ticket/46 +Debian: http://bugs.debian.org/743500 +--- + dogtail/config.py | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/dogtail/config.py b/dogtail/config.py +index 80f08bf..1b6ac15 100644 +--- a/dogtail/config.py ++++ b/dogtail/config.py +@@ -3,6 +3,8 @@ from __future__ import absolute_import, division, print_function, unicode_litera + import locale + import os ++import pwd + import sys ++import tempfile + + """ + The configuration module. +@@ -12,7 +13,10 @@ __author__ = "Zack Cerza <zcerza@redhat.com>, David Malcolm <dmalcolm@redhat.com + + def _userTmpDir(baseName): + # i.e. /tmp/dogtail-foo +- return '-'.join(('/'.join(('/tmp', baseName)), os.environ['USER'])) ++ return '-'.join(( ++ '/'.join((tempfile.gettempdir(), baseName)), ++ os.getenv('LOGNAME', os.getenv('USER', pwd.getpwuid(os.getuid())[0])) ++ )) + + + class _Config(object): +-- +2.7.2 + |