aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-06-01 01:50:06 +0000
committerZac Medico <zmedico@gentoo.org>2007-06-01 01:50:06 +0000
commit80df4d593c66a45d855c1986bae3328a866318c7 (patch)
tree0f9cb4c9b18e4192c9cb49c8dbb72dc4f6f4f175
parentFix typo. (diff)
downloadportage-80df4d593c66a45d855c1986bae3328a866318c7.tar.gz
portage-80df4d593c66a45d855c1986bae3328a866318c7.tar.bz2
portage-80df4d593c66a45d855c1986bae3328a866318c7.zip
Add some additional variables to the Packages header.
svn path=/main/trunk/; revision=6705
-rw-r--r--pym/portage/dbapi/bintree.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/pym/portage/dbapi/bintree.py b/pym/portage/dbapi/bintree.py
index 1b9367da1..c3a3aad1d 100644
--- a/pym/portage/dbapi/bintree.py
+++ b/pym/portage/dbapi/bintree.py
@@ -135,6 +135,9 @@ class binarytree(object):
os.path.join(self.pkgdir, "All"))
self._pkgindex_file = os.path.join(self.pkgdir, "Packages")
self._pkgindex_keys = set(["CPV", "SLOT", "MTIME", "SIZE"])
+ self._pkgindex_header_keys = set(["ACCEPT_KEYWORDS", "CBUILD",
+ "CHOST", "CONFIG_PROTECT", "CONFIG_PROTECT_MASK", "FEATURES",
+ "GENTOO_MIRRORS", "INSTALL_MASK", "SYNC", "USE"])
def move_ent(self, mylist):
if not self.populated:
@@ -682,6 +685,7 @@ class binarytree(object):
else:
del d[k]
pkgindex.packages[cpv] = d
+ self._update_pkgindex_header(pkgindex.header)
from portage.util import atomic_ofstream
f = atomic_ofstream(os.path.join(self.pkgdir, "Packages"))
try:
@@ -692,6 +696,19 @@ class binarytree(object):
if pkgindex_lock:
unlockfile(pkgindex_lock)
+ def _update_pkgindex_header(self, header):
+ portdir = normalize_path(os.path.realpath(self.settings["PORTDIR"]))
+ profiles_base = os.path.join(portdir, "profiles")
+ profile_path = normalize_path(os.path.realpath(self.settings.profile_path))
+ profile_path = profile_path.lstrip(profiles_base)
+ header["PROFILE"] = profile_path
+ for k in self._pkgindex_header_keys:
+ v = self.settings.get(k, None)
+ if v:
+ header[k] = v
+ else:
+ header.pop(k, None)
+
def exists_specific(self, cpv):
if not self.populated:
self.populate()