From: Michael Tremer Date: Fri, 23 Apr 2021 14:15:49 +0000 (+0000) Subject: builder: Initialise environment only for some operations X-Git-Tag: 0.9.28~1285^2~251 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d0da349e8fb396e51a1c6c097625545ca7ec59a7;p=pakfire.git builder: Initialise environment only for some operations Signed-off-by: Michael Tremer --- diff --git a/src/pakfire/builder.py b/src/pakfire/builder.py index cfa382838..e85c2971b 100644 --- a/src/pakfire/builder.py +++ b/src/pakfire/builder.py @@ -148,9 +148,6 @@ class BuilderContext(object): # Get a reference to the logger self.log = self.builder.log - # Setup the environment - self._setup() - @property def environ(self): # Build a minimal environment for executing, but try to inherit TERM and LANG @@ -217,6 +214,9 @@ class BuilderContext(object): return ret def build(self, path, shell=True): + # Setup the environment + self._setup() + # Open the package archive archive = _pakfire.Archive(self.pakfire, path) @@ -268,6 +268,9 @@ class BuilderContext(object): raise e def shell(self, packages=[], install=None): + # Setup the environment + self._setup() + archives = [] if not util.cli_is_interactive():