summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-util/dogtail/files')
-rw-r--r--dev-util/dogtail/files/dogtail-0.9.0-gentoo-paths.patch43
-rw-r--r--dev-util/dogtail/files/dogtail-0.9.0-get-user.patch28
2 files changed, 71 insertions, 0 deletions
diff --git a/dev-util/dogtail/files/dogtail-0.9.0-gentoo-paths.patch b/dev-util/dogtail/files/dogtail-0.9.0-gentoo-paths.patch
new file mode 100644
index 000000000000..7c4acfb62884
--- /dev/null
+++ b/dev-util/dogtail/files/dogtail-0.9.0-gentoo-paths.patch
@@ -0,0 +1,43 @@
+diff --git a/sniff/sniff b/sniff/sniff
+index 86771f9..05f4c6a 100755
+--- a/sniff/sniff
++++ b/sniff/sniff
+@@ -45,23 +45,14 @@ 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 is '/': # in case the path is /bin/sniff
+- path = '/usr'
+- self.builder.add_from_file(path +
++ self.builder.add_from_file(@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,
++ self.app.set_icon_from_file(os.path.join(@EPREFIX_USR@,
+ 'share/icons/hicolor/scalable/apps/dogtail-head.svg'))
+ self.setUpWidgets()
+ self.connectSignals()
+@@ -666,11 +657,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 is '/':
+- 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
+
diff --git a/dev-util/dogtail/files/dogtail-0.9.0-get-user.patch b/dev-util/dogtail/files/dogtail-0.9.0-get-user.patch
new file mode 100644
index 000000000000..07a6ad807467
--- /dev/null
+++ b/dev-util/dogtail/files/dogtail-0.9.0-get-user.patch
@@ -0,0 +1,28 @@
+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
+
+--- a/dogtail/config.py 2015-06-08 22:59:08.664107350 +0200
++++ b/dogtail/config.py 2015-06-08 22:57:54.433669729 +0200
+@@ -6,11 +6,15 @@ __author__ = "Zack Cerza <zcerza@redhat.com>, David Malcolm <dmalcolm@redhat.com
+ import os
+ import sys
+ import locale
++import tempfile
+
+
+ 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', os.getlogin()))
++ ))
+
+
+ class _Config(object):