Bug 1312290 - Force package extension when building AUR packages on Arch Linux. r=gps
authorLeo Schwarz <evotopid@gmail.com>
Tue, 25 Oct 2016 10:28:59 +0200
changeset 319793 490cc18cf93fb8da6df4e940345f77bd463bb083
parent 319792 b9851671ac002a0c1b4598e292422988d8f5b7c2
child 319794 9f9d69a704e15b0288e6710b51d97d13748ff7a8
push id20748
push userphilringnalda@gmail.com
push dateFri, 28 Oct 2016 03:39:55 +0000
treeherderfx-team@715360440695 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs1312290
milestone52.0a1
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
python/mozboot/mozboot/archlinux.py
--- a/python/mozboot/mozboot/archlinux.py
+++ b/python/mozboot/mozboot/archlinux.py
@@ -163,18 +163,18 @@ class ArchlinuxBootstrapper(BaseBootstra
 
         self.run_as_root(command)
 
     def pacman_update(self):
         command = ['pacman', '-S', '--refresh']
 
         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]
         self.run(command)
 
     def unpack(self, path, name, ext):
         if ext == 'gz':
             compression = '-z'
@@ -184,18 +184,20 @@ class ArchlinuxBootstrapper(BaseBootstra
             compression == 'x'
 
         name = os.path.join(path, name) + '.tar.' + ext
         command = ['tar', '-x', compression, '-f', name, '-C', path]
         self.run(command)
 
     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')
         command.append(pack)
         self.run_as_root(command)
 
     def aur_install(self, *packages):
         path = tempfile.mkdtemp()