Make file_get() redirect FETCHCOMMAND output to stdout just like
authorZac Medico <zmedico@gentoo.org>
Fri, 11 Apr 2008 21:58:31 +0000 (21:58 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 11 Apr 2008 21:58:31 +0000 (21:58 -0000)
portage.fetch() does. Thanks to Ramereth for reporting. (trunk r9844)

svn path=/main/branches/2.1.2/; revision=9845

pym/getbinpkg.py

index d20a549ed7dd7be77cc445c8d2dd0897cf54cf3d..861e98dd8826ccd139a8b3b202886f4cc557782a 100644 (file)
@@ -398,7 +398,12 @@ def file_get(baseurl,dest,conn=None,fcmd=None):
        lexer = shlex.shlex(StringIO.StringIO(fcmd), posix=True)
        lexer.whitespace_split = True
        myfetch = [varexpand(x, mydict=variables) for x in lexer]
-       retval = spawn(myfetch, env=os.environ.copy())
+       fd_pipes= {
+               0:sys.stdin.fileno(),
+               1:sys.stdout.fileno(),
+               2:sys.stdout.fileno()
+       }
+       retval = spawn(myfetch, env=os.environ.copy(), fd_pipes=fd_pipes)
        if retval != os.EX_OK:
                sys.stderr.write("Fetcher exited with a failure condition.\n")
                return 0