]> git.pld-linux.org Git - projects/pld-builder.new.git/commitdiff
Create tmpdir with chroot command
authorKacper Kornet <draenog@pld-linux.org>
Fri, 7 Dec 2012 09:33:43 +0000 (09:33 +0000)
committerKacper Kornet <draenog@pld-linux.org>
Fri, 7 Dec 2012 10:13:36 +0000 (10:13 +0000)
builder user can have no permission to write directly
in chroot.

PLD_Builder/request.py
PLD_Builder/rpm_builder.py

index 767cefcea9cae08bf9b4a862a5bbd935c8af4bd1..a01d59379ea6e5a25836415f5457e7efd2d3a0e1 100644 (file)
@@ -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):
index 6cb20add2a66022f68a26a1336ee436a94970b0e..4a1ac2f3a95964ec9dbdaaf35fd32be90285a9e0 100644 (file)
@@ -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 " \
This page took 0.301724 seconds and 4 git commands to generate.