Bug 1246872 - Find the source bundle directory by pattern matching for OS X artifact builds. r=nalexander
MozReview-Commit-ID: 7Yn2pO9PO1C
--- 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',