app-portage/layman: Bump with patch, fixes bug 582154
authorBrian Dolbec <dolsen@gentoo.org>
Tue, 31 May 2016 14:19:21 +0000 (07:19 -0700)
committerBrian Dolbec <dolsen@gentoo.org>
Tue, 31 May 2016 14:20:16 +0000 (07:20 -0700)
Package-Manager: portage-2.3.0_rc1

app-portage/layman/files/layman-2.4.1-sourcefileattributechanges.patch [new file with mode: 0644]
app-portage/layman/layman-2.4.1-r1.ebuild [moved from app-portage/layman/layman-2.4.1.ebuild with 96% similarity]

diff --git a/app-portage/layman/files/layman-2.4.1-sourcefileattributechanges.patch b/app-portage/layman/files/layman-2.4.1-sourcefileattributechanges.patch
new file mode 100644 (file)
index 0000000..207f474
--- /dev/null
@@ -0,0 +1,42 @@
+From 90fe6724d0a8d1ebfe6443dee118432e20432b8b Mon Sep 17 00:00:00 2001
+From: Brian Dolbec <dolsen@gentoo.org>
+Date: Tue, 10 May 2016 15:12:02 -0700
+Subject: [PATCH] layman/module.py: Fix commit 63808ef00f94 mis-applied
+ 'sourcefile' attribute changes
+
+It was not looking for the 'sourcefile' attribute first, then falling back to the kidname for
+backward compatibility.
+It was incorrectly looking for an ImportError, instead of a 'sourcefile' KeyError.
+The filepath of the affected file for the error message had an extra leading '_'.
+Add the module name to the warning message.
+---
+ layman/module.py | 11 ++++++-----
+ 1 file changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/layman/module.py b/layman/module.py
+index 08bcbc2..092418f 100644
+--- a/layman/module.py
++++ b/layman/module.py
+@@ -49,13 +49,14 @@ class Module(object):
+             kid = self.module_spec['provides'][submodule]
+             kidname = kid['name']
+             try:
++                kid['module_name'] = '.'.join([mod_name, kid['sourcefile']])
++            except KeyError:
+                 kid['module_name'] = '.'.join([mod_name, kidname])
+-            except ImportError:
+-                kid['module_name'] = '.'.join([mod_name, self.name])
+-                f = self.__module.__file__
+-                msg = 'Module.__initialize(); module spec is old, missing '\
++                f = self._module.__file__
++                msg = 'Module.__initialize(); %(module)s module spec is old, missing '\
+                       'attribute: \'sourcefile\'.\nBackward compatibility '\
+-                      'may be removed in the future.\nFile: %(f)s' % {'f': f}
++                      'may be removed in the future.\nFile: %(f)s' % {
++                      'module': self.name, 'f': f}
+                 self.output.warn(msg)
+             kid['is_imported'] = False
+             self.kids[kidname] = kid
+-- 
+2.8.3
+
similarity index 96%
rename from app-portage/layman/layman-2.4.1.ebuild
rename to app-portage/layman/layman-2.4.1-r1.ebuild
index 79dcd8c0df727ef939873108b6c37d70ed67a20d..748813befa99cb059653b36bb6d215a4e4889848 100644 (file)
@@ -41,6 +41,10 @@ RDEPEND="
        >=dev-python/ssl-fetch-0.4[${PYTHON_USEDEP}]
        "
 
+PATCHES=(
+       "${FILESDIR}/layman-2.4.1-sourcefileattributechanges.patch"
+)
+
 layman_check_kernel_config() {
        local CONFIG_CHECK
        use squashfs && CONFIG_CHECK+=" ~BLK_DEV_LOOP ~SQUASHFS"