From 992b09d6b01aaa91fee4396c61d2e8eefc902c57 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sun, 28 Oct 2012 12:06:15 +0100 Subject: [PATCH] builder: Make lots of things about the build environment configurable. --- examples/builder.conf | 15 +++++++++++++++ python/pakfire/builder.py | 20 +++++++++++++------- 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/examples/builder.conf b/examples/builder.conf index 4a9829a7c..21972ea04 100644 --- a/examples/builder.conf +++ b/examples/builder.conf @@ -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 diff --git a/python/pakfire/builder.py b/python/pakfire/builder.py index 98707b2df..23776bd58 100644 --- a/python/pakfire/builder.py +++ b/python/pakfire/builder.py @@ -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): """ -- 2.39.5