pld-builder.new: PLD_Builder/chroot.py - no stdin only for run()

arekm arekm at pld-linux.org
Mon Mar 29 21:05:52 CEST 2010


Author: arekm                        Date: Mon Mar 29 19:05:52 2010 GMT
Module: pld-builder.new               Tag: HEAD
---- Log message:
- no stdin only for run()

---- Files affected:
pld-builder.new/PLD_Builder:
   chroot.py (1.36 -> 1.37) 

---- Diffs:

================================================================
Index: pld-builder.new/PLD_Builder/chroot.py
diff -u pld-builder.new/PLD_Builder/chroot.py:1.36 pld-builder.new/PLD_Builder/chroot.py:1.37
--- pld-builder.new/PLD_Builder/chroot.py:1.36	Mon Mar 29 17:38:57 2010
+++ pld-builder.new/PLD_Builder/chroot.py	Mon Mar 29 21:05:47 2010
@@ -14,11 +14,13 @@
 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 @@
     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)
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/pld-builder.new/PLD_Builder/chroot.py?r1=1.36&r2=1.37&f=u



More information about the pld-cvs-commit mailing list