summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-08-15 07:08:03 +0000
committerZac Medico <zmedico@gentoo.org>2009-08-15 07:08:03 +0000
commit61febc7a779917dde5a39b2e02456ef97869d53d (patch)
tree1bbb4c073076b9bae297d328b462ae963c3e3903
parent2a841b102f7a852d937d62c57a1cd44f55e6e45b (diff)
downloadportage-61febc7a779917dde5a39b2e02456ef97869d53d.tar.gz
portage-61febc7a779917dde5a39b2e02456ef97869d53d.tar.bz2
portage-61febc7a779917dde5a39b2e02456ef97869d53d.zip
Make movefile() use process.spawn() instead of getstatusoutput() when calling
MOVE_BINARY, since spawn will pass encoded file paths directly as arguments. svn path=/main/trunk/; revision=14061
-rw-r--r--pym/portage/__init__.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index f8f0e222c..25cac3e12 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -7293,11 +7293,12 @@ def movefile(src, dest, newmtime=None, sstat=None, mysettings=None,
return None
else:
#we don't yet handle special, so we need to fall back to /bin/mv
- a = commands.getstatusoutput("%s -f %s %s" % \
- (MOVE_BINARY, _shell_quote(src), _shell_quote(dest)))
- if a[0] != os.EX_OK:
+ a = process.spawn([MOVE_BINARY, '-f', src, dest], env=os.environ)
+ if a != os.EX_OK:
writemsg("!!! Failed to move special file:\n", noiselevel=-1)
- writemsg("!!! '%s' to '%s'\n" % (src, dest), noiselevel=-1)
+ writemsg("!!! '%s' to '%s'\n" % \
+ (_unicode_decode(src, encoding=encoding),
+ _unicode_decode(dest, encoding=encoding)), noiselevel=-1)
writemsg("!!! %s\n" % a, noiselevel=-1)
return None # failure
try: