From: Michael Tremer Date: Sun, 10 Jan 2021 15:06:29 +0000 (+0000) Subject: Drop internal builder X-Git-Tag: 0.9.28~1285^2~911 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a97f50dd0b3ff1780a450ace273e8b6884645a63;p=pakfire.git Drop internal builder Signed-off-by: Michael Tremer --- diff --git a/Makefile.am b/Makefile.am index 5797ff76f..b2ecd1d1d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -110,10 +110,6 @@ install-exec-local: $(LN_S) -vf pakfire pakfire-daemon && \ $(LN_S) -vf pakfire pakfire-key - $(MKDIR_P) $(DESTDIR)/$(scriptsdir) - cd $(DESTDIR)/$(scriptsdir) && \ - $(LN_S) -vf ../../bin/pakfire builder - # ------------------------------------------------------------------------------ pakfire_PYTHON = \ diff --git a/src/pakfire/builder.py b/src/pakfire/builder.py index 165722203..2f3e41ed9 100644 --- a/src/pakfire/builder.py +++ b/src/pakfire/builder.py @@ -462,10 +462,6 @@ class BuilderContext(object): # Sanitize language. "LANG" : os.environ.setdefault("LANG", "en_US.UTF-8"), - - # Set the container that we can detect, if we are inside a - # chroot. - "container" : "pakfire-builder", }) # Inherit environment from distro diff --git a/src/pakfire/cli.py b/src/pakfire/cli.py index 44a1b5a1c..ba52fed4e 100644 --- a/src/pakfire/cli.py +++ b/src/pakfire/cli.py @@ -391,14 +391,6 @@ class Cli(object): class CliBuilder(Cli): - def __init__(self): - Cli.__init__(self) - - # Check if we are already running in a pakfire container. In that - # case, we cannot start another pakfire-builder. - if os.environ.get("container", None) == "pakfire-builder": - raise PakfireContainerError(_("You cannot run pakfire-builder in a pakfire chroot")) - def parse_cli(self): parser = argparse.ArgumentParser( description = _("Pakfire builder command line interface"), @@ -530,71 +522,6 @@ class CliBuilder(Cli): Cli.handle_provides(self, int=True) -class CliBuilderIntern(Cli): - def __init__(self): - self.parser = argparse.ArgumentParser( - description = _("Pakfire builder command line interface."), - ) - self._add_common_arguments(self.parser) - - # Add sub-commands. - self.sub_commands = self.parser.add_subparsers() - - self.parse_command_build() - - # Finally parse all arguments from the command line and save them. - self.args = self.parser.parse_args() - - self.action2func = { - "build" : self.handle_build, - } - - def parse_command_build(self): - # Implement the "build" command. - sub_build = self.sub_commands.add_parser("build", - help=_("Build one or more packages.")) - sub_build.add_argument("package", nargs=1, - help=_("Give name of at least one package to build.")) - sub_build.add_argument("action", action="store_const", const="build") - - sub_build.add_argument("-a", "--arch", - help=_("Build the package for the given architecture.")) - sub_build.add_argument("--resultdir", nargs="?", - help=_("Path were the output files should be copied to.")) - sub_build.add_argument("-m", "--mode", nargs="?", default="development", - help=_("Mode to run in. Is either 'release' or 'development' (default).")) - sub_build.add_argument("--nodeps", action="store_true", - help=_("Do not verify build dependencies.")) - sub_build.add_argument("--prepare", action="store_true", - help=_("Only run the prepare stage.")) - - def handle_build(self): - # Get the package descriptor from the command line options - pkg = self.args.package[0] - - # Check, if we got a regular file - if os.path.exists(pkg): - pkg = os.path.abspath(pkg) - else: - raise FileNotFoundError(pkg) - - # Create pakfire instance. - c = config.ConfigBuilder() - p = base.Pakfire(arch = self.args.arch, config = c) - - # Disable all repositories. - if self.args.nodeps: - p.repos.disable_repo("*") - - # Limit stages that are to be run. - if self.args.prepare: - stages = ["prepare"] - else: - stages = None - - p.build(pkg, resultdir=self.args.resultdir, stages=stages) - - class CliClient(Cli): def __init__(self): # Create connection to pakfire hub diff --git a/src/scripts/pakfire b/src/scripts/pakfire index e805f9912..dc1a51503 100755 --- a/src/scripts/pakfire +++ b/src/scripts/pakfire @@ -51,7 +51,6 @@ basename2cls = { "pakfire-client" : pakfire.cli.CliClient, "pakfire-daemon" : pakfire.cli.CliDaemon, "pakfire-key" : pakfire.cli.CliKey, - "builder" : pakfire.cli.CliBuilderIntern, } # Get the basename of the program