From: Zac Medico Date: Fri, 22 Jun 2007 06:21:04 +0000 (-0000) Subject: Make quickpkg print a warning if "bindist" is in RESTRICT. (trunk r6937) X-Git-Tag: v2.1.3~173 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2ace7d1f719c7d0962073ef3805359deb4e5b2bf;p=portage.git Make quickpkg print a warning if "bindist" is in RESTRICT. (trunk r6937) svn path=/main/branches/2.1.2/; revision=6938 --- diff --git a/bin/quickpkg b/bin/quickpkg index d32a92fcb..8442a263f 100755 --- a/bin/quickpkg +++ b/bin/quickpkg @@ -57,9 +57,10 @@ def tar_contents(contents, root, tar, onProgress=None): onProgress(maxval, curval) def quickpkg_main(options, args, eout): - from portage import dblink, dep_expand, catsplit, isvalidatom, xpak + from portage import catsplit, dblink, dep_expand, flatten, isvalidatom, xpak + from portage_dep import use_reduce, paren_reduce from portage_util import ensure_dirs - from portage_exception import InvalidData + from portage_exception import InvalidData, InvalidDependString import tarfile import portage root = portage.settings["ROOT"] @@ -104,12 +105,24 @@ def quickpkg_main(options, args, eout): if not dblnk.exists(): # unmerged by a concurrent process continue - iuse, use = vardb.aux_get(cpv, ["IUSE","USE"]) + iuse, use, restrict = vardb.aux_get(cpv, + ["IUSE","USE","RESTRICT"]) iuse = [ x.lstrip("+-") for x in iuse.split() ] use = use.split() + try: + restrict = flatten(use_reduce( + paren_reduce(restrict), uselist=use)) + except InvalidDependString, e: + eout.eerror("Invalid RESTRICT metadata " + \ + "for '%s': %s; skipping" % (cpv, str(e))) + del e + continue if "bindist" in iuse and "bindist" not in use: eout.ewarn("%s: package was emerged with USE=-bindist!" % cpv) eout.ewarn("%s: it may not be legal to redistribute this." % cpv) + elif "bindist" in restrict: + eout.ewarn("%s: package has RESTRICT=bindist!" % cpv) + eout.ewarn("%s: it may not be legal to redistribute this." % cpv) eout.ebegin("Building package for %s" % cpv) pkgs_for_arg += 1 contents = dblnk.getcontents()