From patchwork Wed Jul 18 14:31:44 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 171699 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 7BF452C00BF for ; Thu, 19 Jul 2012 00:32:02 +1000 (EST) Received: from localhost ([::1]:46064 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SrVIG-0002m9-Jn for incoming@patchwork.ozlabs.org; Wed, 18 Jul 2012 10:32:00 -0400 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 Received: from rincewind.home.kraxel.org (ovpn-116-34.ams2.redhat.com [10.36.116.34]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q6IEVkWr006613; Wed, 18 Jul 2012 10:31:46 -0400 Received: by rincewind.home.kraxel.org (Postfix, from userid 500) id 3F47B40C96; Wed, 18 Jul 2012 16:31:45 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Wed, 18 Jul 2012 16:31:44 +0200 Message-Id: <1342621904-25303-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: Gerd Hoffmann Subject: [Qemu-devel] [PATCH] improve scripts/make-release X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org '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 Reviewed-by: Eric Blake --- 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