aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2018-04-09 18:32:04 -0700
committerZac Medico <zmedico@gentoo.org>2018-04-09 18:32:04 -0700
commit232aae7f1fd79573426c0da9c1cbd79324994099 (patch)
tree8e867b631888f3deb7a588a34020e15d56bfeba7
parent_pkg_str: add _db attribute (bug 640318) (diff)
downloadportage-232aae7f1fd79573426c0da9c1cbd79324994099.tar.gz
portage-232aae7f1fd79573426c0da9c1cbd79324994099.tar.bz2
portage-232aae7f1fd79573426c0da9c1cbd79324994099.zip
binarytree._update_pkgindex_header: skip update if profile invalid (bug 640318)
Return silently if the current profile is invalid or does not have an IUSE_IMPLICIT variable, since it's useful to maintain a cache of implicit IUSE settings for use with binary packages. Bug: https://bugs.gentoo.org/640318
-rw-r--r--pym/portage/dbapi/bintree.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/pym/portage/dbapi/bintree.py b/pym/portage/dbapi/bintree.py
index 42d334d24..ab4f4760d 100644
--- a/pym/portage/dbapi/bintree.py
+++ b/pym/portage/dbapi/bintree.py
@@ -1293,6 +1293,20 @@ class binarytree(object):
translated_keys=self._pkgindex_translated_keys)
def _update_pkgindex_header(self, header):
+ """
+ Add useful settings to the Packages file header, for use by
+ binhost clients.
+
+ This will return silently if the current profile is invalid or
+ does not have an IUSE_IMPLICIT variable, since it's useful to
+ maintain a cache of implicit IUSE settings for use with binary
+ packages.
+ """
+ if not (self.settings.profile_path and
+ "IUSE_IMPLICIT" in self.settings):
+ header.setdefault("VERSION", _unicode(self._pkgindex_version))
+ return
+
portdir = normalize_path(os.path.realpath(self.settings["PORTDIR"]))
profiles_base = os.path.join(portdir, "profiles") + os.path.sep
if self.settings.profile_path: