Bug 1246872 - Find the source bundle directory by pattern matching for OS X artifact builds. r=nalexander draft
authorChris Manchester <cmanchester@mozilla.com>
Mon, 08 Feb 2016 23:03:53 -0800
changeset 329771 f9b0d1645039ae90e169e07bc0e47240a1e689d2
parent 329770 a1cb1143aaa8ffd4103c8767c4f77f17cb60e79d
child 514026 27a281d3995682e9f287842730c40d05b0157a3e
push id10598
push usercmanchester@mozilla.com
push dateTue, 09 Feb 2016 07:09:52 +0000
reviewersnalexander
bugs1246872
milestone47.0a1
Bug 1246872 - Find the source bundle directory by pattern matching for OS X artifact builds. r=nalexander MozReview-Commit-ID: 7Yn2pO9PO1C
python/mozbuild/mozbuild/artifacts.py
--- a/python/mozbuild/mozbuild/artifacts.py
+++ b/python/mozbuild/mozbuild/artifacts.py
@@ -37,16 +37,17 @@ environment.  |mach artifact| ensures th
 consumers will need to arrange this themselves.
 '''
 
 
 from __future__ import absolute_import, print_function, unicode_literals
 
 import collections
 import functools
+import glob
 import hashlib
 import logging
 import operator
 import os
 import pickle
 import re
 import shutil
 import stat
@@ -256,20 +257,20 @@ class MacArtifactJob(ArtifactJob):
             #     return self.install_from_file(filename, distdir)
             #   File "/Users/nalexander/Mozilla/gecko/python/mozbuild/mozbuild/artifacts.py", line 336, in install_from_file
             #     mozinstall.install(filename, tempdir)
             #   File "/Users/nalexander/Mozilla/gecko/objdir-dce/_virtualenv/lib/python2.7/site-packages/mozinstall/mozinstall.py", line 117, in install
             #     install_dir = _install_dmg(src, dest)
             #   File "/Users/nalexander/Mozilla/gecko/objdir-dce/_virtualenv/lib/python2.7/site-packages/mozinstall/mozinstall.py", line 261, in _install_dmg
             #     subprocess.call('hdiutil detach %s -quiet' % appDir,
 
-            # TODO: Extract the bundle name from the archive (it may differ
-            # from MOZ_MACBUNDLE_NAME).
-            bundle_name = 'Nightly.app'
-            source = mozpath.join(tempdir, bundle_name)
+            bundle_dirs = glob.glob(mozpath.join(tempdir, '*.app'))
+            if len(bundle_dirs) != 1:
+                raise ValueError('Expected one source bundle, found: {}'.format(bundle_dirs))
+            [source] = bundle_dirs
 
             # These get copied into dist/bin without the path, so "root/a/b/c" -> "dist/bin/c".
             paths_no_keep_path = ('Contents/MacOS', [
                 'crashreporter.app/Contents/MacOS/crashreporter',
                 'firefox',
                 'firefox-bin',
                 'libfreebl3.dylib',
                 'liblgpllibs.dylib',