From 1ba302d1f5bef464824536cbca757212438cc0e2 Mon Sep 17 00:00:00 2001 From: Chris Manchester Date: Mon, 8 Feb 2016 23:03:53 -0800 Subject: [PATCH] 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 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/python/mozbuild/mozbuild/artifacts.py b/python/mozbuild/mozbuild/artifacts.py index 7e709a8101ba..0a1da9c42acf 100644 --- a/python/mozbuild/mozbuild/artifacts.py +++ b/python/mozbuild/mozbuild/artifacts.py @@ -42,6 +42,7 @@ from __future__ import absolute_import, print_function, unicode_literals import collections import functools +import glob import hashlib import logging import operator @@ -261,10 +262,10 @@ class MacArtifactJob(ArtifactJob): # 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', [