From: Michael Tremer Date: Wed, 13 Jan 2021 22:58:54 +0000 (+0000) Subject: builder: Use pakfire_execute to run shell X-Git-Tag: 0.9.28~1285^2~867 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8a33c1167cd543ea63ebb5ddd2202c151130b61b;p=pakfire.git builder: Use pakfire_execute to run shell Signed-off-by: Michael Tremer --- diff --git a/src/pakfire/builder.py b/src/pakfire/builder.py index 45d7065b0..0eae84a24 100644 --- a/src/pakfire/builder.py +++ b/src/pakfire/builder.py @@ -437,7 +437,7 @@ class BuilderContext(object): env = { "HOME" : "/root", "PATH" : "/usr/bin:/bin:/usr/sbin:/sbin", - "PS1" : "\\u:\w\$ ", + "PS1" : "pakfire-chroot \w> ", "TERM" : os.environ.get("TERM", "vt100"), "LANG" : os.environ.get("LANG", "en_US.UTF-8"), } @@ -521,17 +521,8 @@ class BuilderContext(object): if install: packages += install + # Install all required packages self._install(packages) - command = "/usr/sbin/chroot %s %s %s" % (self.chrootPath(), SHELL_SCRIPT) - - for key, val in list(self.environ.items()): - command = "%s=\"%s\" " % (key, val) + command - - # Empty the environment - command = "env -i - %s" % command - - self.log.debug("Shell command: %s" % command) - - shell = os.system(command) - return os.WEXITSTATUS(shell) + # Enter the shell + self.pakfire.execute(["/usr/bin/bash", "--login"], environ=self.environ)