From: Michael Tremer Date: Sat, 5 Feb 2011 21:22:43 +0000 (+0100) Subject: builder: Start build environment with a login shell. X-Git-Tag: 0.9.3~212 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=63473754f5a51127396ccf09f68281ccedbf5287;p=pakfire.git builder: Start build environment with a login shell. The login shell will initialize the environment and we use this to configure some stuff like ccache and the buildsystem. --- diff --git a/pakfire/builder.py b/pakfire/builder.py index cae012c78..61de74205 100644 --- a/pakfire/builder.py +++ b/pakfire/builder.py @@ -322,10 +322,6 @@ class Builder(object): def environ(self): env = { "BUILDROOT" : self.buildroot, - - # XXX I want to get rid of these too and invoke a login shell - "HOME" : "/root", - "PATH" : "/sbin:/bin:/usr/sbin:/usr/bin", } # Inherit environment from distro @@ -365,16 +361,11 @@ class Builder(object): return ret def make(self, *args, **kwargs): - # XXX need to get rid of this - env = { "PKGROOT" : "/usr/lib/buildsystem" } - try: - kwargs["env"].update(env) - except KeyError: - kwargs["env"] = env + command = ["bash", "--login", "-c",] + command.append("make -f /build/%s %s" % \ + (os.path.basename(self.pkg.filename), " ".join(args))) - return self.do("make -f /build/%s %s" % \ - (os.path.basename(self.pkg.filename), " ".join(args)), - shell=True, **kwargs) + return self.do(command, shell=False, **kwargs) @property def make_info(self):