]> git.pld-linux.org Git - projects/pld-builder.new.git/commitdiff
- no stdin only for run()
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Mon, 29 Mar 2010 19:05:47 +0000 (19:05 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    PLD_Builder/chroot.py -> 1.37

PLD_Builder/chroot.py

index 5b8ac09fe05335156afb99cb26af036aea327736..b5e96b5f76f2ff51264dbd98a1a8c7b9070c84b6 100644 (file)
@@ -14,11 +14,13 @@ from config import config
 def quote(cmd):
     return re.sub("([\"\\\\$`])", r"\\\1", cmd)
     
-def command(cmd, user = None):
+def command(cmd, user = None, nostdin=""):
     if user == None:
         user = config.builder_user
-    return "%s sudo chroot %s su - %s -c \"export LC_ALL=C; %s < /dev/null\"" \
-            % (config.sudo_chroot_wrapper, config.chroot, user, quote(cmd))
+    if nostdin:
+        nostdin = "< /dev/null"
+    return "%s sudo chroot %s su - %s -c \"export LC_ALL=C; %s %s\"" \
+            % (config.sudo_chroot_wrapper, config.chroot, user, quote(cmd), nostdin)
     
 def command_sh(cmd):
     return "%s sudo chroot %s /bin/sh -c \"export LC_ALL=C; %s < /dev/null\"" \
@@ -29,7 +31,7 @@ def popen(cmd, user = "builder", mode = "r"):
     return f
     
 def run(cmd, user = "builder", logfile = None, logstdout = None):
-    c = command(cmd, user)
+    c = command(cmd, user, nostdin=True)
     if logfile != None:
         if logstdout != None:
             c = "%s 2>&1 | /usr/bin/tee -a %s" % (c, logfile)
This page took 0.038146 seconds and 4 git commands to generate.