aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2019-08-10 11:44:11 -0700
committerZac Medico <zmedico@gentoo.org>2019-08-10 11:51:11 -0700
commit03b441713d299a04c6bdba10e0fbd5ba2340a68d (patch)
treefce8b2ede0e4a40778917b830677f936f2e72eba
parent_xattr._XattrSystemCommands.{get,list}: Do not hide stderr and fix ResourceWa... (diff)
downloadportage-03b441713d299a04c6bdba10e0fbd5ba2340a68d.tar.gz
portage-03b441713d299a04c6bdba10e0fbd5ba2340a68d.tar.bz2
portage-03b441713d299a04c6bdba10e0fbd5ba2340a68d.zip
bin/ebuild: Fix to work with installed package
Fix the following AttributeError error: # ebuild /var/db/pkg/sys-apps/portage-2.3.71/portage-2.3.71.ebuild clean pretend clean Traceback (most recent call last): File "/usr/lib/python-exec/python3.6/ebuild", line 318, in <module> type_name=pkg_type) File "/usr/lib64/python3.6/site-packages/_emerge/Package.py", line 72, in __init__ db = self.cpv._db AttributeError: 'str' object has no attribute '_db' Bug: https://bugs.gentoo.org/532674 Fixes: bfe7892202b8 ("_pkg_str: add _db attribute (bug 640318)") Signed-off-by: Zac Medico <zmedico@gentoo.org>
-rwxr-xr-xbin/ebuild7
1 files changed, 6 insertions, 1 deletions
diff --git a/bin/ebuild b/bin/ebuild
index baa842570..460aa0fd1 100755
--- a/bin/ebuild
+++ b/bin/ebuild
@@ -1,5 +1,5 @@
#!/usr/bin/python -b
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
from __future__ import print_function
@@ -312,6 +312,11 @@ except PortageKeyError:
root_config = RootConfig(portage.settings,
portage.db[portage.settings['EROOT']], None)
+cpv = portage.versions._pkg_str(cpv,
+ metadata=metadata,
+ settings=portage.settings,
+ db=portage.db[portage.settings['EROOT']][mytree].dbapi)
+
pkg = Package(built=(pkg_type != "ebuild"), cpv=cpv,
installed=(pkg_type=="installed"),
metadata=metadata, root_config=root_config,