Skip to contentSkip to conversation

add a SNAPSHOT flag to be able to generate snapshots from CVS

PATCH In review Carlo Marcelo Arenas Belon 2 participants 2 messages Jan 22, 2007 – Jan 24, 2007 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 add a SNAPSHOT flag to be able to generate snapshots from CVS

Greetings,

The following patch adds a "SNAPSHOT" variable to the Makefile which can be changed to "yes" (or any other value) so that make -k tar generates a snapshot tar (on a configured or not CVS tree) instead of a release source tar (useful when debugging a version of the CVS tree) by using a generated version based on the current date through GNU date.

Only the name of the tar is changed so to keep all internal logic that relies in the version unchanged.

Carlo

Index: Makefile
===================================================================
RCS file: /sources/qemu/qemu/Makefile,v
retrieving revision 1.110

Makefile +11 -1
diff -u -r1.110 Makefile
@@ -8,6 +8,8 @@
 BASE_CFLAGS=
 BASE_LDFLAGS=
 
+SNAPSHOT=
+
 BASE_CFLAGS += $(OS_CFLAGS)
 ifeq ($(ARCH),sparc)
 BASE_CFLAGS += -mcpu=ultrasparc
@@ -128,7 +130,15 @@
 
 html: qemu-doc.html qemu-tech.html
 
-FILE=qemu-$(shell cat VERSION)
+ifndef VERSION
+VERSION=$(shell cat VERSION)
+endif
+
+ifneq ($(SNAPSHOT),)
+SNAPSHOT=.$(shell date -u "+%Y%m%d%H%M")
+endif
+
+FILE=qemu-$(VERSION)$(SNAPSHOT)
 
 # tar release (use 'make -k tar' on a checkouted tree)
 tar:
#1 lore raw
Quoted 31 lines · Carlo Marcelo Arenas Belon

Greetings,

The following patch adds a "SNAPSHOT" variable to the Makefile which can be changed to "yes" (or any other value) so that make -k tar generates a snapshot tar (on a configured or not CVS tree) instead of a release source tar (useful when debugging a version of the CVS tree) by using a generated version based on the current date through GNU date.

Only the name of the tar is changed so to keep all internal logic that relies in the version unchanged.

Carlo

Index: Makefile
===================================================================
RCS file: /sources/qemu/qemu/Makefile,v
retrieving revision 1.110
diff -u -r1.110 Makefile

Makefile +2 -0
@@ -8,6 +8,8 @@
 BASE_CFLAGS=
 BASE_LDFLAGS=
 
+SNAPSHOT=
+
 BASE_CFLAGS += $(OS_CFLAGS)
 ifeq ($(ARCH),sparc)
 BASE_CFLAGS += -mcpu=ultrasparc
@@ -128,7 +130,15 @@
 

Makefile line 139

Quoted 10 lines
Makefile +7 -1
 html: qemu-doc.html qemu-tech.html
 
-FILE=qemu-$(shell cat VERSION)
+ifndef VERSION
+VERSION=$(shell cat VERSION)
+endif
+
+ifneq ($(SNAPSHOT),)
+SNAPSHOT=.$(shell date -u "+%Y%m%d%H%M")
+endif

This doesn't work as intended, the SNAPSHOT won't expand to date because it was overridden from the command line. I made VERSION overridable instead, this allows to achieve the same effect.

Thiemo