]> git.ipfire.org Git - pakfire.git/commitdiff
builder: Download transaction and run it
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 12 May 2019 13:01:35 +0000 (14:01 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 12 May 2019 13:01:35 +0000 (14:01 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/pakfire/builder.py

index 0abc40019a6e0569d4b7a89aedbae39e7e9d1c75..140519f67a69d896488cf2ca2e46380b57fb8b00 100644 (file)
@@ -35,6 +35,7 @@ from . import arch
 from . import base
 from . import cgroup
 from . import config
+from . import downloaders
 from . import logger
 from . import packages
 from . import repository
@@ -518,9 +519,21 @@ class BuilderContext(object):
                # Logging
                self.log.debug(_("Installing build requirements: %s") % ", ".join(packages))
 
-               # Initialise Pakfire and install all required packages
+               # Initialise Pakfire
                with self.pakfire as p:
-                       p.install(packages)
+                       # Install all required packages
+                       transaction = p.install(packages)
+
+                       # Dump transaction to log
+                       t = transaction.dump()
+                       self.log.info(t)
+
+                       # Download transaction
+                       d = downloaders.TransactionDownloader(self.pakfire, transaction)
+                       d.download()
+
+                       # Run the transaction
+                       transaction.run()
 
        def build(self, package, private_network=True, shell=True):
                package = self._prepare_package(package)