Patchwork [3,of,3,stable] osx: use bdist_mpkg.script_bdist_mpkg module instead of bdist_mpkg command

login
register
mail settings
Submitter Mads Kiilerich
Date Jan. 21, 2015, 4:05 a.m.
Message ID <d9450110a2ddec5fba8b.1421813101@localhost.localdomain>
Download mbox | patch
Permalink /patch/7524/
State Accepted
Commit d7a90949fc184dc1068706f45bf88b351f15559d
Headers show

Comments

Mads Kiilerich - Jan. 21, 2015, 4:05 a.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1421813088 -3600
#      Wed Jan 21 05:04:48 2015 +0100
# Branch stable
# Node ID d9450110a2ddec5fba8b0b64f2d9578491aa438a
# Parent  4107a0722f9fbeb7374b4365dadc3b279fccb4a5
osx: use bdist_mpkg.script_bdist_mpkg module instead of bdist_mpkg command

It seems like a default installation of bdist_mpkg makes it available as
Python module, but the corresponding executable is placed in a location like
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/bin which not
is in $PATH and thus not directly available. 'make osx' would thus fail.

Instead, skip the bdist_mpkg executable and invoke it as a Python module. That
works out of the box here.
Matt Mackall - Jan. 21, 2015, 7:31 p.m.
On Wed, 2015-01-21 at 05:05 +0100, Mads Kiilerich wrote:
> # HG changeset patch
> # User Mads Kiilerich <madski@unity3d.com>
> # Date 1421813088 -3600
> #      Wed Jan 21 05:04:48 2015 +0100
> # Branch stable
> # Node ID d9450110a2ddec5fba8b0b64f2d9578491aa438a
> # Parent  4107a0722f9fbeb7374b4365dadc3b279fccb4a5
> osx: use bdist_mpkg.script_bdist_mpkg module instead of bdist_mpkg command

These are queued for default, thanks.

Patch

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -136,10 +136,10 @@  i18n/hg.pot: $(PYFILES) $(DOCFILES) i18n
 # Packaging targets
 
 osx:
-	@which bdist_mpkg >/dev/null || \
+	python -c 'import bdist_mpkg.script_bdist_mpkg' || \
 	   (echo "Missing bdist_mpkg (easy_install bdist_mpkg)"; false)
 	rm -rf dist/mercurial-*.mpkg
-	bdist_mpkg setup.py --
+	python -m bdist_mpkg.script_bdist_mpkg setup.py --
 	mkdir -p packages/osx
 	N=`cd dist && echo mercurial-*.mpkg | sed 's,\.mpkg$$,,'` && hdiutil create -srcfolder dist/$$N.mpkg/ -scrub -volname "$$N" -ov packages/osx/$$N.dmg
 	rm -rf dist/mercurial-*.mpkg