From: Michael Tremer Date: Sun, 10 Jan 2021 16:53:45 +0000 (+0000) Subject: python: Drop PakfireBuilder class X-Git-Tag: 0.9.28~1285^2~904 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6b71dcfe545b94512d8feb26942e10dde5d4dd2a;p=pakfire.git python: Drop PakfireBuilder class This has mostly been replaced with the newer build environment Signed-off-by: Michael Tremer --- diff --git a/src/pakfire/base.py b/src/pakfire/base.py index c5d82e5b3..77490baae 100644 --- a/src/pakfire/base.py +++ b/src/pakfire/base.py @@ -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",) diff --git a/src/pakfire/daemon.py b/src/pakfire/daemon.py index 0d31584aa..8326cdf4e 100644 --- a/src/pakfire/daemon.py +++ b/src/pakfire/daemon.py @@ -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()