]> git.ipfire.org Git - pakfire.git/commitdiff
python: Drop PakfireBuilder class
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 10 Jan 2021 16:53:45 +0000 (16:53 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 10 Jan 2021 16:53:45 +0000 (16:53 +0000)
This has mostly been replaced with the newer build environment

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/pakfire/base.py
src/pakfire/daemon.py

index c5d82e5b3f6b4474a982f4d8781272696b92732f..77490baaec27d6268489e5c904c0cdf677529aa9 100644 (file)
@@ -352,101 +352,6 @@ class PakfireContext(object):
                t.run()
 
 
-class PakfireBuilder(Pakfire):
-       def __init__(self, distro_name=None, *args, **kwargs):
-               self.distro_name = distro_name
-
-               kwargs.update({
-                       "path" : os.path.join(BUILD_ROOT, util.random_string()),
-               })
-
-               Pakfire.__init__(self, *args, **kwargs)
-
-               # Let's see what is our host distribution.
-               self.host_distro = distro.Distribution()
-
-       def _load_config(self, files=None):
-               c = config.ConfigBuilder(files=files)
-
-               if self.distro_name is None:
-                       self.distro_name = c.get("builder", "distro", None)
-
-               if self.distro_name:
-                       c.load_distro_config(self.distro_name)
-
-               if not c.has_distro_conf():
-                       log.error(_("You have not set the distribution for which you want to build."))
-                       log.error(_("Please do so in builder.conf or on the CLI."))
-                       raise ConfigError(_("Distribution configuration is missing."))
-
-               return c
-
-       def build(self, pkg, resultdirs=None, shell=False, install_test=True, after_shell=False, **kwargs):
-               # As the BuildEnviron is only able to handle source packages, we must package makefiles.
-               if pkg.endswith(".%s" % MAKEFILE_EXTENSION):
-                       pkg = self.dist(pkg, resultdir=LOCAL_TMP_PATH)
-
-               b = builder.BuildEnviron(self, pkg, **kwargs)
-
-               try:
-                       # Start to prepare the build environment by mounting
-                       # the filesystems and extracting files.
-                       b.start()
-
-                       try:
-                               # Build the package.
-                               b.build(install_test=install_test)
-
-                       except BuildError:
-                               # Raise the error, if the user does not want to
-                               # have a shell.
-                               if not shell:
-                                       raise
-
-                               # Run a shell to debug the issue.
-                               b.shell()
-
-                       # Copy-out all resultfiles if the build was successful.
-                       if not resultdirs:
-                               resultdirs = []
-
-                       # Always include local repository.
-                       resultdirs.append(self.repos.local_build.path)
-
-                       for resultdir in resultdirs:
-                               if not resultdir:
-                                       continue
-
-                               b.copy_result(resultdir)
-
-                       # If the user requests a shell after a successful build,
-                       # we run it here.
-                       if after_shell:
-                               b.shell()
-
-               finally:
-                       b.stop()
-
-       def shell(self, pkg, **kwargs):
-               # As the BuildEnviron is only able to handle source packages, we must package makefiles.
-               if pkg and pkg.endswith(".%s" % MAKEFILE_EXTENSION):
-                       pkg = self.dist(pkg, resultdir=LOCAL_TMP_PATH)
-
-               b = builder.BuildEnviron(self, pkg, **kwargs)
-
-               try:
-                       b.start()
-
-                       try:
-                               b.build(prepare=True)
-                       except BuildError:
-                               pass
-
-                       b.shell()
-               finally:
-                       b.stop()
-
-
 class PakfireServer(Pakfire):
        def repo_create(self, path, input_paths, name=None, key_id=None, type="binary"):
                assert type in ("binary", "source",)
index 0d31584aa05708eae746884d3f4d87c9b73977ca..8326cdf4eaac598d71054e3859de7d79a33739c3 100644 (file)
@@ -492,7 +492,8 @@ class PakfireWorker(multiprocessing.Process):
                        # Create pakfire instance.
                        p = None
                        try:
-                               p = pakfire.base.PakfireBuilder(config=config, arch=job.arch)
+                               # PakfireBuilder has been removed
+                               #p = pakfire.base.PakfireBuilder(config=config, arch=job.arch)
 
                                # Download the source package.
                                client = http.Client()