qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] improve scripts/make-release
@ 2012-07-18 14:31 Gerd Hoffmann
  2012-07-18 14:41 ` Eric Blake
  0 siblings, 1 reply; 2+ messages in thread
From: Gerd Hoffmann @ 2012-07-18 14:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann

'make dist' creates a tarball for the current checkout.
'make qemu-${version}.tar.bz2' creates a tarball for git tag v${version}.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 Makefile             |    5 ++---
 scripts/make-release |    8 +++++++-
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index ab82ef3..4a5f399 100644
--- a/Makefile
+++ b/Makefile
@@ -233,9 +233,8 @@ clean:
 	rm -f $$d/qemu-options.def; \
         done
 
-VERSION ?= $(shell cat VERSION)
-
-dist: qemu-$(VERSION).tar.bz2
+dist:
+	$(SRC_PATH)/scripts/make-release "$(SRC_PATH)"
 
 qemu-%.tar.bz2:
 	$(SRC_PATH)/scripts/make-release "$(SRC_PATH)" "$(patsubst qemu-%.tar.bz2,%,$@)"
diff --git a/scripts/make-release b/scripts/make-release
index 196c755..181ca77 100755
--- a/scripts/make-release
+++ b/scripts/make-release
@@ -12,11 +12,17 @@
 
 src="$1"
 version="$2"
+if test "$version" = ""; then
+	commit=$(git describe --long)
+	version="${commit#v}"
+else
+	commit="v${version}"
+fi
 destination=qemu-${version}
 
 git clone "${src}" ${destination}
 pushd ${destination}
-git checkout "v${version}"
+git checkout "${commit}"
 git submodule update --init
 rm -rf .git roms/*/.git
 popd
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-07-18 14:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-18 14:31 [Qemu-devel] [PATCH] improve scripts/make-release Gerd Hoffmann
2012-07-18 14:41 ` Eric Blake

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).