From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43949) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SrVI7-0002lS-Lz for qemu-devel@nongnu.org; Wed, 18 Jul 2012 10:31:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SrVI3-00061v-OP for qemu-devel@nongnu.org; Wed, 18 Jul 2012 10:31:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60289) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SrVI3-00061o-G7 for qemu-devel@nongnu.org; Wed, 18 Jul 2012 10:31:47 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6IEVk0G030726 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 18 Jul 2012 10:31:46 -0400 From: Gerd Hoffmann Date: Wed, 18 Jul 2012 16:31:44 +0200 Message-Id: <1342621904-25303-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH] improve scripts/make-release List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 --- 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