summaryrefslogtreecommitdiffstats
path: root/pym/portage
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-06-07 18:57:04 +0000
committerZac Medico <zmedico@gentoo.org>2007-06-07 18:57:04 +0000
commitd8cbd2f92c83461e37d20b3416c54beb1b5c985f (patch)
tree0e8bdbe2ec88216f060711b1fb8895f276cc876d /pym/portage
parent42c29e4246af51f221c7030c443771be6ca45d2f (diff)
downloadportage-d8cbd2f92c83461e37d20b3416c54beb1b5c985f.tar.gz
portage-d8cbd2f92c83461e37d20b3416c54beb1b5c985f.tar.bz2
portage-d8cbd2f92c83461e37d20b3416c54beb1b5c985f.zip
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.
svn path=/main/trunk/; revision=6750
Diffstat (limited to 'pym/portage')
-rw-r--r--pym/portage/__init__.py24
-rw-r--r--pym/portage/dep.py2
2 files changed, 14 insertions, 12 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index b6fbf2cad..4c6a9ce0d 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -2354,7 +2354,7 @@ def spawn(mystring, mysettings, debug=0, free=0, droppriv=0, sesandbox=0, **keyw
keywords["fd_pipes"] = fd_pipes
features = mysettings.features
- restrict = mysettings.get("RESTRICT", "").split()
+ restrict = mysettings.get("PORTAGE_RESTRICT","").split()
droppriv=(droppriv and "userpriv" in features and not \
("nouserpriv" in restrict or "userpriv" in restrict))
if droppriv and not uid and portage_gid and portage_uid:
@@ -2421,9 +2421,10 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks",
"fetch files. Will use digest file if available."
features = mysettings.features
+ restrict = mysettings.get("PORTAGE_RESTRICT","").split()
# 'nomirror' is bad/negative logic. You Restrict mirroring, not no-mirroring.
- if ("mirror" in mysettings["RESTRICT"].split()) or \
- ("nomirror" in mysettings["RESTRICT"].split()):
+ if "mirror" in restrict or \
+ "nomirror" in restrict:
if ("mirror" in features) and ("lmirror" not in features):
# lmirror should allow you to bypass mirror restrictions.
# XXX: This is not a good thing, and is temporary at best.
@@ -2458,8 +2459,8 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks",
if custommirrors.has_key("local"):
mymirrors += custommirrors["local"]
- if ("nomirror" in mysettings["RESTRICT"].split()) or \
- ("mirror" in mysettings["RESTRICT"].split()):
+ if "nomirror" in restrict or \
+ "mirror" in restrict:
# We don't add any mirrors.
pass
else:
@@ -2480,7 +2481,7 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks",
fsmirrors += [mymirrors[x]]
del mymirrors[x]
- restrict_fetch = "fetch" in mysettings["RESTRICT"].split()
+ restrict_fetch = "fetch" in restrict
custom_local_mirrors = custommirrors.get("local", [])
if restrict_fetch:
# With fetch restriction, a normal uri may only be fetched from
@@ -2527,7 +2528,7 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks",
if restrict_fetch:
# Only fetch from specific mirrors is allowed.
continue
- if "primaryuri" in mysettings["RESTRICT"].split():
+ if "primaryuri" in restrict:
# Use the source site first.
if primaryuri_indexes.has_key(myfile):
primaryuri_indexes[myfile] += 1
@@ -3845,13 +3846,14 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
#initial dep checks complete; time to process main commands
+ restrict = mysettings["PORTAGE_RESTRICT"].split()
nosandbox = (("userpriv" in features) and \
("usersandbox" not in features) and \
- ("userpriv" not in mysettings["RESTRICT"]) and \
- ("nouserpriv" not in mysettings["RESTRICT"]))
+ "userpriv" not in restrict and \
+ "nouserpriv" not in restrict)
if nosandbox and ("userpriv" not in features or \
- "userpriv" in mysettings["RESTRICT"] or \
- "nouserpriv" in mysettings["RESTRICT"]):
+ "userpriv" in restrict or \
+ "nouserpriv" in restrict):
nosandbox = ("sandbox" not in features and \
"usersandbox" not in features)
diff --git a/pym/portage/dep.py b/pym/portage/dep.py
index 445d804e0..9474c1f25 100644
--- a/pym/portage/dep.py
+++ b/pym/portage/dep.py
@@ -263,7 +263,7 @@ def use_reduce(deparray, uselist=[], masklist=[], matchall=0, excludeall=[]):
else:
ismatch = False
if missing_flag:
- raise portage_exception.InvalidDependString(
+ raise portage.exception.InvalidDependString(
"Conditional without flag: \"" + \
paren_enclose([head+"?", newdeparray[-1]])+"\"")