Gentoo Archives: gentoo-commits

From: Paul Varner <fuzzyray@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/revdep_rebuild/
Date: Fri, 05 May 2017 19:38:10
Message-Id: 1494012685.d3ef9ef1bebc7604db0e8c5c49e167e18300c9e9.fuzzyray@gentoo
1 commit: d3ef9ef1bebc7604db0e8c5c49e167e18300c9e9
2 Author: Paul Varner <fuzzyray <AT> gentoo <DOT> org>
3 AuthorDate: Fri May 5 19:31:25 2017 +0000
4 Commit: Paul Varner <fuzzyray <AT> gentoo <DOT> org>
5 CommitDate: Fri May 5 19:31:25 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=d3ef9ef1
7
8 revdep_rebuild/settings.py: Fix traceback error with Python3.6 (bug 617498)
9
10 The portage.root variable is using late binding. This breaks in Python3.6
11 where the type is being checked before use in os.path.join(). This fix
12 creates a new variable of the correct type from the value of portage.root
13 instead of using portage.root directly.
14
15 X-Gentoo-bug: 617498
16 X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=617498
17 Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>
18
19 pym/gentoolkit/revdep_rebuild/settings.py | 17 ++++++++++++-----
20 1 file changed, 12 insertions(+), 5 deletions(-)
21
22 diff --git a/pym/gentoolkit/revdep_rebuild/settings.py b/pym/gentoolkit/revdep_rebuild/settings.py
23 index 589ea29..9a00f45 100644
24 --- a/pym/gentoolkit/revdep_rebuild/settings.py
25 +++ b/pym/gentoolkit/revdep_rebuild/settings.py
26 @@ -15,12 +15,19 @@ import glob
27 import portage
28 from portage import _encodings, _unicode_decode, _unicode_encode
29
30 +if sys.version_info[0] >= 3:
31 + _unicode = str
32 +else:
33 + _unicode = unicode
34 +
35 +portage_root = _unicode(portage.root)
36 +
37 DEFAULTS = {
38 - 'DEFAULT_LD_FILE': os.path.join(portage.root, 'etc/ld.so.conf'),
39 - 'DEFAULT_ENV_FILE': os.path.join(portage.root, 'etc/profile.env'),
40 - 'REVDEP_CONFDIR': os.path.join(portage.root, 'etc/revdep-rebuild/'),
41 - 'PKG_DIR': os.path.join(portage.root, 'var/db/pkg/'),
42 - 'DEFAULT_TMP_DIR': os.path.join(portage.root, '/tmp/revdep-rebuild' if os.getgid() else '/var/cache/revdep-rebuild'), #cache default location
43 + 'DEFAULT_LD_FILE': os.path.join(portage_root, 'etc/ld.so.conf'),
44 + 'DEFAULT_ENV_FILE': os.path.join(portage_root, 'etc/profile.env'),
45 + 'REVDEP_CONFDIR': os.path.join(portage_root, 'etc/revdep-rebuild/'),
46 + 'PKG_DIR': os.path.join(portage_root, 'var/db/pkg/'),
47 + 'DEFAULT_TMP_DIR': os.path.join(portage_root, '/tmp/revdep-rebuild' if os.getgid() else '/var/cache/revdep-rebuild'), #cache default location
48
49 # number of maximum allowed files to be parsed at once
50 'CMD_MAX_ARGS': 1000,