From: Zac Medico Date: Sat, 5 Apr 2008 20:03:43 +0000 (-0000) Subject: When necessary, make quickpkg add missing metadata to the vdb entry before X-Git-Tag: v2.1.5~242 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4614f5371857b8cc6fa952e309cd9664c8c9c3e2;p=portage.git When necessary, make quickpkg add missing metadata to the vdb entry before creating the binary package. (trunk r9723) svn path=/main/branches/2.1.2/; revision=9724 --- diff --git a/bin/quickpkg b/bin/quickpkg index fedb1b3fe..a5d67ac3d 100755 --- a/bin/quickpkg +++ b/bin/quickpkg @@ -4,6 +4,7 @@ # $Id$ import errno, signal, stat, sys, os +from itertools import izip def tar_contents(contents, root, tar, protect=None, onProgress=None): from portage_util import normalize_path @@ -91,6 +92,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) @@ -162,6 +164,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()))