archive = _pakfire.Archive(self.pakfire, package)
requires = archive.get("dependencies.requires")
- packages += requires.splitlines()
+ if requires:
+ packages += requires.splitlines()
# Setup the environment including any build dependencies
self._install(packages)
- # XXX perform build
+ # Extract the source archive (if we have one)
+ if archive:
+ archive.extract("%s/build" % self.pakfire.path)
+
+ def shell(self, packages=[], install=None):
+ archives = []
- def shell(self, install=None):
if not util.cli_is_interactive():
self.log.warning("Cannot run shell on non-interactive console.")
return
+ # Open all archives
+ for path in packages:
+ archive = _pakfire.Archive(self.pakfire, path)
+ archives.append(archive)
+
# Collect packages to install
packages = []
if install:
packages += install
+ # Install all build requirements for archives
+ for archive in archives:
+ requires = archive.get("dependencies.requires")
+ if requires:
+ packages += requires.splitlines()
+
# Install all required packages
self._install(packages)
+ # Extract archives
+ for archive in archives:
+ archive.extract("%s/build" % self.pakfire.path)
+
# Enter the shell
self.pakfire.execute(["/usr/bin/bash", "--login"],
environ=self.environ, enable_network=True, interactive=True)
# shell
shell = subparsers.add_parser("shell", help=_("Go into a build shell"))
- shell.add_argument("package", nargs="?", help=_("Give name of a package"))
+ shell.add_argument("package", nargs="*", help=_("Give name of a package"))
shell.add_argument("--install", nargs="*",
help=_("Packages that should be installed in the shell"))
shell.set_defaults(func=self.handle_shell)
def handle_shell(self, ns):
with self.builder(ns) as b:
- b.shell(install=ns.install)
+ b.shell(packages=ns.package, install=ns.install)
def handle_dist(self, ns):
# Get the packages from the command line options