From: Zac Medico Date: Sat, 15 Aug 2009 07:08:03 +0000 (-0000) Subject: Make movefile() use process.spawn() instead of getstatusoutput() when calling X-Git-Tag: v2.2_rc39~60 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=61febc7a779917dde5a39b2e02456ef97869d53d;p=portage.git 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 --- 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: