]> git.ipfire.org Git - pakfire.git/commitdiff
Correctly parse the configuration sent by the hub.
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 28 Feb 2012 22:18:17 +0000 (23:18 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 28 Feb 2012 22:18:17 +0000 (23:18 +0100)
python/pakfire/builder.py
python/pakfire/client/builder.py

index 517ff27e579994d7f866798c5f565de8b9ecba0a..94da4cf9ec802ca72f1924d937d05de6da92c37b 100644 (file)
@@ -66,8 +66,8 @@ class BuildEnviron(object):
        # The version of the kernel this machine is running.
        kernel_version = os.uname()[2]
 
-       def __init__(self, filename=None, distro_name=None, configs=None, arch=None, build_id=None, logfile=None,
-                       builder_mode="release", use_cache=None, **pakfire_args):
+       def __init__(self, filename=None, distro_name=None, config=None, configs=None, arch=None,
+                       build_id=None, logfile=None, builder_mode="release", use_cache=None, **pakfire_args):
                # Set mode.
                assert builder_mode in ("development", "release",)
                self.mode = builder_mode
@@ -121,12 +121,13 @@ class BuildEnviron(object):
                if pakfire_args.has_key("mode"):
                        del pakfire_args["mode"]
 
-               config = ConfigBuilder(files=configs)
-               if not configs:
-                       if distro_name is None:
-                               distro_name = config.get("builder", "distro", None)
+               if config is None:
+                       config = ConfigBuilder(files=configs)
 
-                       config.load_distro_config(distro_name)
+                       if not configs:
+                               if distro_name is None:
+                                       distro_name = config.get("builder", "distro", None)
+                               config.load_distro_config(distro_name)
 
                if not config.has_distro():
                        log.error(_("You have not set the distribution for which you want to build."))
index 1364274440eb1bc50ee148e6536d1482913ba9c6..32dff2308250697ab057950489076ab003d704ac 100644 (file)
@@ -385,15 +385,17 @@ class ClientBuilder(object):
                                        if not self.build_source_hash512 == h.hexdigest():
                                                raise DownloadError, "Hash check did not succeed."
 
-                               # Write configuration to file.
-                               f = open(cfgfile, "w")
-                               f.write(self.build_config)
-                               print self.build_config
-                               f.close()
+                               # Build configuration.
+                               config = pakfire.config.Config(files=["general.conf"])
+
+                               # Parse the configuration received from the build service.
+                               config.parse(self.build_config)
 
                                # Create dict with arguments that are passed to the pakfire
                                # builder.
                                kwargs = {
+                                       "config"        : config,
+
                                        # Of course this is a release build.
                                        # i.e. don't use local packages.
                                        "builder_mode"  : "release",
@@ -404,12 +406,6 @@ class ClientBuilder(object):
                                        # Files and directories (should be self explaining).
                                        "logfile"       : logfile,
 
-                                       # Configuration files to load.
-                                       "configs"       : [
-                                               os.path.join(CONFIG_DIR, "general.conf"),
-                                               cfgfile,
-                                       ],
-
                                        # Perform the build for this architecture.
                                        "arch"          : self.build_arch,
                                }