From 0056ce78d4c0a3a07352c85aedc3739ad6f37121 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 8 Jun 2007 20:11:41 +0000 Subject: Make all the python code respect USE conditionals in RESTRICT. It's already handled on the bash side since RESTRICT is assigned the value of PORTAGE_RESTRICT. (trunk r6750) svn path=/main/branches/2.1.2/; revision=6764 --- bin/emerge | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'bin/emerge') diff --git a/bin/emerge b/bin/emerge index 7bfad6d23..ddac9edff 100755 --- a/bin/emerge +++ b/bin/emerge @@ -2418,6 +2418,8 @@ class depgraph: depth >= mylist[i+1][1]: del mylist[i] + from portage import flatten + from portage_dep import use_reduce, paren_reduce display_overlays=False # files to fetch list - avoids counting a same file twice # in size display (verbose mode) @@ -2476,9 +2478,17 @@ class depgraph: self.useFlags[myroot][pkg_key] = mydbapi.aux_get( pkg_key, ["USE"])[0].split() + try: + restrict = flatten(use_reduce(paren_reduce( + mydbapi.aux_get(pkg_key, ["RESTRICT"])[0]), + uselist=self.useFlags[myroot][pkg_key])) + except portage_exception.InvalidDependString, e: + restrict = mydbapi.aux_get(pkg_key, ["RESTRICT"])[0] + show_invalid_depstring_notice(x, restrict, str(e)) + del e + sys.exit(1) if "ebuild" == pkg_type and x[3] != "nomerge" and \ - "fetch" in portdb.aux_get( - x[2], ["RESTRICT"])[0].split(): + "fetch" in restrict: fetch = red("F") if ordered: counters.restrict_fetch += 1 -- cgit v1.2.3-1-g7c22