From 059e00f68aba240ef6dee93b2ac68640872c4d4b Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 30 Jul 2007 03:21:33 +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. (branches/2.1.2 r6763:6765) svn path=/main/branches/2.1.2.9/; revision=7452 --- bin/emerge | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'bin/emerge') diff --git a/bin/emerge b/bin/emerge index e1209640e..31868d2fb 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) @@ -2456,6 +2458,7 @@ class depgraph: blockers.append(addl) else: mydbapi = self.trees[myroot][self.pkg_tree_map[pkg_type]].dbapi + pkg_status = x[3] binary_package = True if "ebuild" == pkg_type: if "merge" == x[3] or \ @@ -2476,9 +2479,19 @@ 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: + if pkg_status != "nomerge": + restrict = mydbapi.aux_get(pkg_key, ["RESTRICT"])[0] + show_invalid_depstring_notice(x, restrict, str(e)) + del e + sys.exit(1) + restrict = [] 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