From ff15ac138c8af9aec6cbf35a60b693f211a319e8 Mon Sep 17 00:00:00 2001 From: Fabian Groffen Date: Sun, 18 Mar 2007 21:30:15 +0000 Subject: [PATCH] Merged from trunk 6245:6247 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 | 9 ++++----- bin/fperms | 9 ++++----- pym/portage/output.py | 2 +- pym/portage/tests/bin/setup_env.py | 2 +- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/bin/fowners b/bin/fowners index 30f375545..424add968 100755 --- a/bin/fowners +++ b/bin/fowners @@ -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}}" diff --git a/bin/fperms b/bin/fperms index 950843617..cf28a2aab 100755 --- a/bin/fperms +++ b/bin/fperms @@ -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}}" diff --git a/pym/portage/output.py b/pym/portage/output.py index d68094150..d7f051f53 100644 --- a/pym/portage/output.py +++ b/pym/portage/output.py @@ -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: """ diff --git a/pym/portage/tests/bin/setup_env.py b/pym/portage/tests/bin/setup_env.py index a69a19ec6..1f2491701 100644 --- a/pym/portage/tests/bin/setup_env.py +++ b/pym/portage/tests/bin/setup_env.py @@ -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) -- 2.26.2