Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configure scripts cannot use pipe characters inside run() commands #223

Open
gerhardqux opened this issue Mar 5, 2015 · 0 comments
Open

Comments

@gerhardqux
Copy link

The run() implementation fails on pipe characters as of:
a37894a

[root@(none) /]# ./test
1: 0 qux
+ echo qux | sort | sort
sort: fflush failed: standard output: Broken pipe
sort: write error
[root@(none) /]# cat test
#!/usr/bin/env python

import commands
import sys

def run(cmd):
    sys.stderr.write('+ ' + cmd + '\n')
    status, output = commands.getstatusoutput(cmd + ' </dev/null')
    sys.stderr.write(output + '\n')
    if status != 0:
        sys.stderr.write("Command '%s' failed\n" % cmd)
        sys.stderr.write("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n")
        sys.stderr.write("!!! Configure script exited prematurely !!!\n")
        sys.stderr.write("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n")
        sys.exit(status)

testcmd='echo qux | sort | sort'

status, output = commands.getstatusoutput(testcmd)
sys.stderr.write("1: %d %s\n" % (status, output))

run(testcmd)

#run('echo bar | sort | sort')
#run('ls /sys/block/ | grep "^sd" >/after')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant