X-Git-Url: https://git.tld-linux.org/?p=tld-builder.git;a=blobdiff_plain;f=TLD_Builder%2Fchroot.py;fp=TLD_Builder%2Fchroot.py;h=b790e51dbbad431885d46b3ff2f25d59de526448;hp=8acd58d10abd628384e8b39960ec30cca3dcf031;hb=284d49e1cdca63cde4114c123815e9f0b7e8dbdb;hpb=86579a75a741c01cbbc8d78fdaf8932a2cf179b3 diff --git a/TLD_Builder/chroot.py b/TLD_Builder/chroot.py index 8acd58d..b790e51 100644 --- a/TLD_Builder/chroot.py +++ b/TLD_Builder/chroot.py @@ -28,7 +28,12 @@ def command_sh(cmd): % (config.sudo_chroot_wrapper, config.chroot, quote(cmd)) def popen(cmd, user = "builder", mode = "r"): - f = os.popen(command(cmd, user), mode) + if mode == "r": + p = subprocess.Popen(command(cmd, user), shell=True, stdout=subprocess.PIPE, close_fds=True) + f = p.stdout + else: + p = subprocess.Popen(command(cmd, user), shell=True, stdin=subprocess.PIPE, close_fds=True) + f = p.stdin return f def run(cmd, user = "builder", logfile = None, logstdout = None):