summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-06-22 06:13:46 +0000
committerZac Medico <zmedico@gentoo.org>2007-06-22 06:13:46 +0000
commit83878c034e3d6be49165f4e06afe97a5084af2e6 (patch)
tree42b8dd93d0b61ad2b52ea0900ef04d570c4e3f04
parent22efe874cea08a376d745a64fb231d4ced330ce1 (diff)
downloadportage-83878c034e3d6be49165f4e06afe97a5084af2e6.tar.gz
portage-83878c034e3d6be49165f4e06afe97a5084af2e6.tar.bz2
portage-83878c034e3d6be49165f4e06afe97a5084af2e6.zip
Make quickpkg print a warning if "bindist" is in RESTRICT.
svn path=/main/trunk/; revision=6937
-rwxr-xr-xbin/quickpkg21
1 files changed, 17 insertions, 4 deletions
diff --git a/bin/quickpkg b/bin/quickpkg
index 0070ffac9..17611d6ed 100755
--- a/bin/quickpkg
+++ b/bin/quickpkg
@@ -6,10 +6,11 @@
import errno, signal, sys, os
def quickpkg_main(options, args, eout):
- from portage import dblink, dep_expand, catsplit, isvalidatom, xpak
+ from portage import catsplit, 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.dbapi.vartree import tar_contents
+ from portage.exception import InvalidData, InvalidDependString
+ from portage.dbapi.vartree import dblink, tar_contents
import tarfile
import portage
root = portage.settings["ROOT"]
@@ -54,12 +55,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()