Patchwork [3,of,7,v3,stable,osx-packaging] osx: add support for keeping mpkgs

login
register
mail settings
Submitter Kevin Bullock
Date April 29, 2016, 7:17 p.m.
Message ID <92a03888ff22e6d1c7be.1461957426@billings.local>
Download mbox | patch
Permalink /patch/14833/
State Accepted
Headers show

Comments

Kevin Bullock - April 29, 2016, 7:17 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1461038368 14400
#      Mon Apr 18 23:59:28 2016 -0400
# Branch stable
# Node ID 92a03888ff22e6d1c7be2f82ee018e4f20acc5c9
# Parent  13219c6c0aa43fc3a29efb0af20ac6934906337c
osx: add support for keeping mpkgs

This is a bit of a hack, but I don't really want to mount a dmg during
a test, and I don't see an option with hdiutil to take a dmg and spit
out a folder, so this is what we've got for now.

Patch

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -165,8 +165,9 @@  osx:
 	  mkdir -p $$OUTPUTDIR && \
 	  N=`cd dist && echo mercurial-*.mpkg | sed 's,\.mpkg$$,,'` && \
 	  hdiutil create -srcfolder dist/$$N.mpkg/ -scrub -volname "$$N" \
-	    -ov $$OUTPUTDIR/$$N.dmg
-	rm -rf dist/mercurial-*.mpkg
+	    -ov $$OUTPUTDIR/$$N.dmg && \
+	  [ -n "$$KEEPMPKG" ] && mv dist/mercurial-*.mpkg $$OUTPUTDIR || \
+	  rm -rf dist/mercurial-*.mpkg
 
 deb:
 	contrib/builddeb