Sanitize the root parameter specified to portageq.
authorJason Stubbs <jstubbs@gentoo.org>
Mon, 26 Dec 2005 16:11:47 +0000 (16:11 -0000)
committerJason Stubbs <jstubbs@gentoo.org>
Mon, 26 Dec 2005 16:11:47 +0000 (16:11 -0000)
svn path=/main/trunk/; revision=2482

bin/portageq

index 0b9f60cc59171b578a340453ce9c2828c1bb62ce..744a838e7cd3f033a0a02138efde3bef4648b774 100755 (executable)
@@ -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)