summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-04-05 19:51:28 +0000
committerZac Medico <zmedico@gentoo.org>2008-04-05 19:51:28 +0000
commit8d4e46926287f9c596cc1886c3bceac37824a7bb (patch)
treeaf03a70b467c2466601a1095931727c60eed4ab7
parent205161c4dd0420320114bd74dcaecc8bd0897f41 (diff)
downloadportage-8d4e46926287f9c596cc1886c3bceac37824a7bb.tar.gz
portage-8d4e46926287f9c596cc1886c3bceac37824a7bb.tar.bz2
portage-8d4e46926287f9c596cc1886c3bceac37824a7bb.zip
When necessary, make quickpkg add missing metadata to the vdb entry before
creating the binary package. svn path=/main/trunk/; revision=9723
-rwxr-xr-xbin/quickpkg14
1 files changed, 14 insertions, 0 deletions
diff --git a/bin/quickpkg b/bin/quickpkg
index 226b7bd82..92bce027c 100755
--- a/bin/quickpkg
+++ b/bin/quickpkg
@@ -4,6 +4,7 @@
# $Id$
import errno, signal, sys, os
+from itertools import izip
def quickpkg_main(options, args, eout):
from portage import catsplit, dep_expand, flatten, isvalidatom, xpak
@@ -31,6 +32,7 @@ def quickpkg_main(options, args, eout):
config_files_excluded = 0
include_config = options.include_config == "y"
include_unmodified_config = options.include_unmodified_config == "y"
+ fix_metadata_keys = ["PF", "CATEGORY"]
for arg in args:
try:
atom = dep_expand(arg, mydb=vardb, settings=vartree.settings)
@@ -102,6 +104,18 @@ def quickpkg_main(options, args, eout):
return False
excluded_config_files.append(filename)
return True
+ existing_metadata = dict(izip(fix_metadata_keys,
+ vardb.aux_get(cpv, fix_metadata_keys)))
+ category, pf = portage.catsplit(cpv)
+ required_metadata = {}
+ required_metadata["CATEGORY"] = category
+ required_metadata["PF"] = pf
+ update_metadata = {}
+ for k, v in required_metadata.iteritems():
+ if v != existing_metadata[k]:
+ update_metadata[k] = v
+ if update_metadata:
+ vardb.aux_update(cpv, update_metadata)
xpdata = xpak.xpak(dblnk.dbdir)
binpkg_tmpfile = os.path.join(bintree.pkgdir,
cpv + ".tbz2." + str(os.getpid()))