]> git.ipfire.org Git - pakfire.git/commitdiff
builder: Make lots of things about the build environment configurable.
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 28 Oct 2012 11:06:15 +0000 (12:06 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 28 Oct 2012 11:06:15 +0000 (12:06 +0100)
examples/builder.conf
python/pakfire/builder.py

index 4a9829a7c8d005133fbcdb7b4eb107a14148ec80..21972ea04cdfc6d69e0bfbbbeb75ed901200321e 100644 (file)
@@ -3,3 +3,18 @@
 
 # Use a different log file for the builder stuff.
 file = /var/log/pakfire-builder.log
+
+[builder]
+# Use ccache in order to build rebuilds in less time.
+#use_ccache = true
+
+# Use icecream in order to speed up builds.
+#use_icecream = false
+
+# Create build environments in a tmpfs.
+# This requires a lot of RAM.
+# Only enable if you know what your are doing.
+#use_tmpfs = false
+
+# Create loop devices in build environment.
+#use_loop_devices = true
index 98707b2df30f0572675ef8d4dcefbde341d66e85..23776bd588e7b5c18e8cd618b05d7db2936faf4c 100644 (file)
@@ -110,15 +110,14 @@ class BuildEnviron(object):
                        for line in BUILD_LOG_HEADER.splitlines():
                                self.log.info(line % logdata)
 
-               # XXX need to make this configureable
+               # Settings array.
                self.settings = {
-                       "enable_loop_devices" : True,
-                       "enable_ccache"   : True,
-                       "enable_icecream" : False,
-                       "sign_packages"   : False,
-                       "buildroot_tmpfs" : False,
+                       "enable_loop_devices" : self.config.get_bool("builder", "use_loop_devices", True),
+                       "enable_ccache"       : self.config.get_bool("builder", "use_ccache", True),
+                       "enable_icecream"     : self.config.get_bool("builder", "use_icecream", False),
+                       "sign_packages"       : False,
+                       "buildroot_tmpfs"     : self.config.get_bool("builder", "use_tmpfs", False),
                }
-               #self.settings.update(settings)
 
                # Try to get the configured host key. If it is available,
                # we will automatically sign all packages with it.
@@ -209,6 +208,13 @@ class BuildEnviron(object):
                # Remove all files.
                self.destroy()
 
+       @property
+       def config(self):
+               """
+                       Proxy method for easy access to the configuration.
+               """
+               return self.pakfire.config
+
        @property
        def distro(self):
                """