Skip to contentSkip to conversation

xen/makefile: Allow XEN_CHANGESET to be set externally

PATCH In review Andrew Cooper 3 participants 4 messages May 17, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---

Changes from v1:
* Rebase on top of "Use {git, hg, svn} commit id if available for xen_changeset"

xen/Makefile +2 -1
diff -r 2369a9d759f0 -r 396ebb07e2d0 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 > [email protected]
 	@grep \" .banner >> [email protected]
 	@grep -v \" .banner
#1 lore raw
Quoted 4 lines · Andrew Cooper

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

#2 lore raw
Quoted 9 lines · Olaf Hering
Quoted 4 lines · Andrew Cooper

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"

I have however identified a bug with the way in which xen/tools/scmversion deals with git. Patch on the way.

~Andrew

#3 lore raw
Quoted 6 lines · Andrew Cooper
Quoted 5 lines · Olaf Hering
Quoted 3 lines · Andrew Cooper

Build systems based on tarballs rather than source code trees, such as rpms/debs are unable to obtain changeset infomation.

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

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.