Bug 1312290 - Force package extension when building AUR packages on Arch Linux. r=gps

Previously if an Arch Linux user had a different package extension configured
in `/etc/makepkg.conf` building AUR packages during bootstrap would fail.
Forcing the extension by providing it as an environment variable makes sure
building doesn't fail regarding of a user's configuration.

MozReview-Commit-ID: 4aryYS0XVr7

--HG--
extra : rebase_source : 4c466e49f729de625e814a92325c6d38e6d1e0b4
This commit is contained in:
Leo Schwarz 2016-10-25 10:28:59 +02:00
parent 6f1eb05923
commit 33768e74f6

View File

@ -168,8 +168,8 @@ class ArchlinuxBootstrapper(BaseBootstrapper):
self.run_as_root(command)
def run(self, command):
subprocess.check_call(command, stdin=sys.stdin)
def run(self, command, env=None):
subprocess.check_call(command, stdin=sys.stdin, env=env)
def download(self, uri):
command = ['curl', '-L', '-O', uri]
@ -189,8 +189,10 @@ class ArchlinuxBootstrapper(BaseBootstrapper):
def makepkg(self, name):
command = ['makepkg', '-s']
self.run(command)
pack = glob.glob(name + '*.tar.xz')[0]
makepkg_env = os.environ.copy()
makepkg_env['PKGEXT'] = '.pkg.tar.xz'
self.run(command, env=makepkg_env)
pack = glob.glob(name + '*.pkg.tar.xz')[0]
command = ['pacman', '-U']
if self.no_interactive:
command.append('--noconfirm')