Patchwork osx: stamp the hg version into the version field in the pkg

login
register
mail settings
Submitter Augie Fackler
Date Aug. 12, 2016, 9:52 p.m.
Message ID <43a4c2b71bd23dc60334.1471038746@augie-macbookair2.roam.corp.google.com>
Download mbox | patch
Permalink /patch/16264/
State Accepted
Headers show

Comments

Augie Fackler - Aug. 12, 2016, 9:52 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1471038708 14400
#      Fri Aug 12 17:51:48 2016 -0400
# Node ID 43a4c2b71bd23dc603345bf34dced201ff4df1d8
# Parent  f2241c13d5a1100f44278496fe58c05d364b97f8
osx: stamp the hg version into the version field in the pkg

This is required for tools like https://github.com/munki/munki, and is
also more semantically correct.
Yuya Nishihara - Aug. 14, 2016, 2:22 a.m.
On Fri, 12 Aug 2016 17:52:26 -0400, Augie Fackler wrote:
> # HG changeset patch
> # User Augie Fackler <augie@google.com>
> # Date 1471038708 14400
> #      Fri Aug 12 17:51:48 2016 -0400
> # Node ID 43a4c2b71bd23dc603345bf34dced201ff4df1d8
> # Parent  f2241c13d5a1100f44278496fe58c05d364b97f8
> osx: stamp the hg version into the version field in the pkg

Seems fine, queued, thanks.

Patch

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -164,10 +164,12 @@  osx:
 	  --install-lib=/Library/Python/2.7/site-packages/
 	make -C doc all install DESTDIR="$(PWD)/build/mercurial/"
 	mkdir -p $${OUTPUTDIR:-dist}
-	pkgbuild --root build/mercurial/ --identifier org.mercurial-scm.mercurial \
-	  build/mercurial.pkg
 	HGVER=$$((cat build/mercurial/Library/Python/2.7/site-packages/mercurial/__version__.py; echo 'print(version)') | python) && \
 	OSXVER=$$(sw_vers -productVersion | cut -d. -f1,2) && \
+	pkgbuild --root build/mercurial/ \
+	  --identifier org.mercurial-scm.mercurial \
+	  --version "$${HGVER}"
+	  build/mercurial.pkg && \
 	productbuild --distribution contrib/macosx/distribution.xml \
 	  --package-path build/ \
 	  --version "$${HGVER}" \