Andrew Cooper
2013-May-17 13:21 UTC
[PATCH] xen/makefile: Allow XEN_CHANGESET to be set externally
Build systems based on tarballs rather than source code trees, such as rpms/debs are unable to obtain changeset infomation. Allow XEN_CHANGESET to be optionally specified in the environment. Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> --- Changes from v1: * Rebase on top of "Use {git, hg, svn} commit id if available for xen_changeset" diff -r 2369a9d759f0 -r 396ebb07e2d0 xen/Makefile --- a/xen/Makefile +++ b/xen/Makefile @@ -13,6 +13,7 @@ export BASEDIR := $(CURDIR) export XEN_ROOT := $(BASEDIR)/.. EFI_MOUNTPOINT ?= /boot/efi +XEN_CHANGESET ?= $(shell tools/scmversion $(XEN_ROOT) || echo "unavailable") .PHONY: default default: build @@ -126,7 +127,7 @@ include/xen/compile.h: include/xen/compi -e ''s/@@version@@/$(XEN_VERSION)/g'' \ -e ''s/@@subversion@@/$(XEN_SUBVERSION)/g'' \ -e ''s/@@extraversion@@/$(XEN_EXTRAVERSION)/g'' \ - -e ''s!@@changeset@@!$(shell tools/scmversion $(XEN_ROOT) || echo "unavailable")!g'' \ + -e ''s!@@changeset@@!$(XEN_CHANGESET)!g'' \ < include/xen/compile.h.in > $@.new @grep \" .banner >> $@.new @grep -v \" .banner
Olaf Hering
2013-May-17 14:32 UTC
Re: [PATCH] xen/makefile: Allow XEN_CHANGESET to be set externally
On Fri, May 17, Andrew Cooper wrote:> Build systems based on tarballs rather than source code trees, such as > rpms/debs are unable to obtain changeset infomation. > > Allow XEN_CHANGESET to be optionally specified in the environment.Isnt that already possible with ''echo "$XEN_CHANGESET" > .scmversion''? Olaf
Andrew Cooper
2013-May-17 14:41 UTC
Re: [PATCH] xen/makefile: Allow XEN_CHANGESET to be set externally
On 17/05/2013 15:32, Olaf Hering wrote:> On Fri, May 17, Andrew Cooper wrote: > >> Build systems based on tarballs rather than source code trees, such as >> rpms/debs are unable to obtain changeset infomation. >> >> Allow XEN_CHANGESET to be optionally specified in the environment. > Isnt that already possible with ''echo "$XEN_CHANGESET" > .scmversion''? > > OlafNo - that results in the literal string "$XEN_CHANGESET" I have however identified a bug with the way in which xen/tools/scmversion deals with git. Patch on the way. ~Andrew
Ian Campbell
2013-May-17 17:04 UTC
Re: [PATCH] xen/makefile: Allow XEN_CHANGESET to be set externally
On Fri, 2013-05-17 at 15:41 +0100, Andrew Cooper wrote:> On 17/05/2013 15:32, Olaf Hering wrote: > > On Fri, May 17, Andrew Cooper wrote: > > > >> Build systems based on tarballs rather than source code trees, such as > >> rpms/debs are unable to obtain changeset infomation. > >> > >> Allow XEN_CHANGESET to be optionally specified in the environment. > > Isnt that already possible with ''echo "$XEN_CHANGESET" > .scmversion''? > > > > Olaf > > No - that results in the literal string "$XEN_CHANGESET"No, because your shell would expand it. In any case Olaf''s point was obviously that you could write whatever string you would like to that file and it would have exactly the same effect as overriding XEN_CHANGESET when calling make. I expect it''s also a little less prone to forgetting to pass it to make on every call. Ian.