pld-builder.new: PLD_Builder/install_br.py Create and delete tmpdi...

arekm arekm at pld-linux.org
Sun Mar 25 04:58:14 CEST 2007


Author: arekm                        Date: Sun Mar 25 02:58:14 2007 GMT
Module: pld-builder.new               Tag: HEAD
---- Log message:
Create and delete tmpdir. There are some (broken anyway) macros (like %patchset_source) that do not check if tmpdir exists and use it unconditionally.

---- Files affected:
pld-builder.new/PLD_Builder:
   install_br.py (1.12 -> 1.13) 

---- Diffs:

================================================================
Index: pld-builder.new/PLD_Builder/install_br.py
diff -u pld-builder.new/PLD_Builder/install_br.py:1.12 pld-builder.new/PLD_Builder/install_br.py:1.13
--- pld-builder.new/PLD_Builder/install_br.py:1.12	Sun Aug 21 23:25:40 2005
+++ pld-builder.new/PLD_Builder/install_br.py	Sun Mar 25 04:58:09 2007
@@ -6,8 +6,10 @@
 import chroot
 
 def install_br(r, b):
-    cmd = "cd rpm/SPECS; TMPDIR=$HOME/%s rpmbuild --nobuild %s %s 2>&1" \
-                % (b.b_id, b.bconds_string(), b.spec)
+    tmpdir = "/tmp/BR." + b.b_id[0:6]
+    chroot.run("install -m 700 -d %s" % tmpdir)
+    cmd = "cd rpm/SPECS; TMPDIR=%s rpmbuild --nobuild %s %s 2>&1" \
+                % (tmpdir, b.bconds_string(), b.spec)
     f = chroot.popen(cmd)
     rx = re.compile(r"^\s*([^\s]+) .*is needed by")
     needed = {}
@@ -17,6 +19,7 @@
         m = rx.search(l)
         if m: needed[m.group(1)] = 1
     f.close()
+    chroot.run("rm -rf %s" % tmpdir)
     if len(needed) == 0:
         b.log_line("no BR needed")
         return
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/pld-builder.new/PLD_Builder/install_br.py?r1=1.12&r2=1.13&f=u



More information about the pld-cvs-commit mailing list