Merged from trunk 6245:6247
authorFabian Groffen <grobian@gentoo.org>
Sun, 18 Mar 2007 21:30:15 +0000 (21:30 -0000)
committerFabian Groffen <grobian@gentoo.org>
Sun, 18 Mar 2007 21:30:15 +0000 (21:30 -0000)
Appropriately use globals() instead of locals() as suggested by marienz.

Revert fowners/fperms hack, as it was almost as broken as SpankMan's
commit.

svn path=/main/branches/prefix/; revision=6248

bin/fowners
bin/fperms
pym/portage/output.py
pym/portage/tests/bin/setup_env.py

index 30f375545aa8cf28098abd105f0ed52ac47c9f44..424add968465f78f7a6417358ddb2a4e8e4aa745 100755 (executable)
@@ -3,8 +3,7 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
-# We want all paths to be in ${ED}, whether or not relative.  The first
-# argument should be the mode, according to the man-page.  It cannot
-# come after the first argument.  That's cool for us.
-mode=$1 ; shift
-exec chown "${mode}" "${@/#/${ED}/}"
+# we can't prefix all arguments because
+# chown takes random options
+slash="/"
+exec chown "${@/#${slash}/${ED}${slash}}"
index 9508436173737ecc8507bfc3f0e3fda85cc1b535..cf28a2aabb5c9e0c4ba8446ebad43a43456f2e19 100755 (executable)
@@ -3,8 +3,7 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
-# We want all paths to be in ${ED}, whether or not relative.  The first
-# argument should be the mode, according to the man-page.  It cannot
-# come after the first argument.  That's cool for us.
-mode=$1 ; shift
-exec chmod "${mode}" "${@/#/${ED}/}"
+# we can't prefix all arguments because
+# chmod takes random options
+slash="/"
+exec chmod "${@/#${slash}/${ED}${slash}}"
index d68094150da496c16e79fde5bddf9848730e33dc..d7f051f53baa181601234936f8a7b8f167511474 100644 (file)
@@ -235,7 +235,7 @@ def create_color_func(color_key):
        return derived_func
 
 for c in compat_functions_colors:
-       locals()[c] = create_color_func(c)
+       globals()[c] = create_color_func(c)
 
 class EOutput:
        """
index a69a19ec6785a53ff877caa8ebd8ead765b4623f..1f249170176bf92fe2619acf11e5ac7b2e244686 100644 (file)
@@ -66,4 +66,4 @@ for bin in os.listdir(bindir):
           bin.startswith("new") or \
           bin.startswith("prep") or \
           bin in ["ecompress","ecompressdir","fowners","fperms"]:
-               locals()[bin] = create_portage_wrapper(bin)
+               globals()[bin] = create_portage_wrapper(bin)