[projects/pld-builder.new] Create tmpdir with chroot command

draenog draenog at pld-linux.org
Fri Dec 7 11:13:57 CET 2012


commit f83b11d5bf41626f2fdb80e621e69d0aa22024b4
Author: Kacper Kornet <draenog at pld-linux.org>
Date:   Fri Dec 7 09:33:43 2012 +0000

    Create tmpdir with chroot command
    
    builder user can have no permission to write directly
    in chroot.

 PLD_Builder/request.py     | 7 -------
 PLD_Builder/rpm_builder.py | 1 +
 2 files changed, 1 insertion(+), 7 deletions(-)
---
diff --git a/PLD_Builder/request.py b/PLD_Builder/request.py
index 767cefc..a01d593 100644
--- a/PLD_Builder/request.py
+++ b/PLD_Builder/request.py
@@ -230,13 +230,6 @@ class Batch:
         # + /usr/bin/bzip2 -dc /home/services/builder/rpm/packages/kernel/patch-2.6.27.61.bz2
         # patch: **** Can't rename file /tmp/B.a1b1d3/poKWwRlp to drivers/scsi/hosts.c : No such file or directory
         path = os.path.join(self._topdir, 'BUILD', 'tmp')
-        chroot_path = config.chroot + path
-        if not os.path.isdir(chroot_path):
-            try:
-                os.makedirs(chroot_path)
-                self.log_line("Creating tmpdir: " + chroot_path)
-            except OSError as e:
-                self.log_line("Cannot create directory %s: %s" % (chroot_path, e.strerror))
         return path
 
     def is_done(self):
diff --git a/PLD_Builder/rpm_builder.py b/PLD_Builder/rpm_builder.py
index 6cb20ad..4a1ac2f 100644
--- a/PLD_Builder/rpm_builder.py
+++ b/PLD_Builder/rpm_builder.py
@@ -195,6 +195,7 @@ def build_rpm(r, b):
         res = "FAIL_SRPM_INSTALL"
     else:
         prepare_env()
+        chroot.run("set -x; install -m 700 -d %s" % tmpdir, logfile=b.logfile)
         b.default_target(config.arch)
         # check for build arch before filling BR
         cmd = "set -ex; TMPDIR=%(tmpdir)s exec nice -n %(nice)s " \
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/projects/pld-builder.new.git/commitdiff/f83b11d5bf41626f2fdb80e621e69d0aa22024b4



More information about the pld-cvs-commit mailing list