summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Stubbs <jstubbs@gentoo.org>2005-12-26 16:11:47 +0000
committerJason Stubbs <jstubbs@gentoo.org>2005-12-26 16:11:47 +0000
commitdd196f9fadc8c2add8de7e05b6ecdfd62569d502 (patch)
tree9d5bc4e1b88dd1a27d9aff1c668094e6762f2479
parent- add back in 1 newline after trimming all the extraneous ones (diff)
downloadportage-multirepo-dd196f9fadc8c2add8de7e05b6ecdfd62569d502.tar.gz
portage-multirepo-dd196f9fadc8c2add8de7e05b6ecdfd62569d502.tar.bz2
portage-multirepo-dd196f9fadc8c2add8de7e05b6ecdfd62569d502.zip
Sanitize the root parameter specified to portageq.
svn path=/main/trunk/; revision=2482
-rwxr-xr-xbin/portageq5
1 files changed, 4 insertions, 1 deletions
diff --git a/bin/portageq b/bin/portageq
index 0b9f60cc..744a838e 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -267,10 +267,13 @@ def main():
cmd = sys.argv[1]
try:
function = globals()[cmd]
- if getattr(function, "uses_root", False) and len(sys.argv) > 2:
+ uses_root = (getattr(function, "uses_root", False) and len(sys.argv) > 2)
+ if uses_root:
os.environ["ROOT"] = sys.argv[2]
global portage
import portage
+ if uses_root:
+ sys.argv[2] = portage.root
function(sys.argv[2:])
except KeyError:
usage(sys.argv)