pld-builder.new: PLD_Builder/chroot.py Better way of forcing /dev/null as s...

arekm arekm at pld-linux.org
Sat Apr 17 22:44:47 CEST 2010


Author: arekm                        Date: Sat Apr 17 20:44:47 2010 GMT
Module: pld-builder.new               Tag: HEAD
---- Log message:
Better way of forcing /dev/null as stdin.

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

---- Diffs:

================================================================
Index: pld-builder.new/PLD_Builder/chroot.py
diff -u pld-builder.new/PLD_Builder/chroot.py:1.37 pld-builder.new/PLD_Builder/chroot.py:1.38
--- pld-builder.new/PLD_Builder/chroot.py:1.37	Mon Mar 29 21:05:47 2010
+++ pld-builder.new/PLD_Builder/chroot.py	Sat Apr 17 22:44:42 2010
@@ -18,12 +18,12 @@
     if user == None:
         user = config.builder_user
     if nostdin:
-        nostdin = "< /dev/null"
+        nostdin = "exec < /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)
+            % (config.sudo_chroot_wrapper, config.chroot, user, nostdin, quote(cmd))
     
 def command_sh(cmd):
-    return "%s sudo chroot %s /bin/sh -c \"export LC_ALL=C; %s < /dev/null\"" \
+    return "%s sudo chroot %s /bin/sh -c \"export LC_ALL=C; exec < /dev/null; %s\"" \
             % (config.sudo_chroot_wrapper, config.chroot, quote(cmd))
 
 def popen(cmd, user = "builder", mode = "r"):
================================================================

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



More information about the pld-cvs-commit mailing list