From patchwork Mon May 24 13:12:14 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 101869 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4ODGTti008789 for ; Mon, 24 May 2010 13:16:29 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756892Ab0EXNQ1 (ORCPT ); Mon, 24 May 2010 09:16:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44499 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754316Ab0EXNQ0 (ORCPT ); Mon, 24 May 2010 09:16:26 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o4ODGQot028315 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 24 May 2010 09:16:26 -0400 Received: from redhat.com (vpn2-8-122.ams2.redhat.com [10.36.8.122]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with SMTP id o4ODGNTr008205; Mon, 24 May 2010 09:16:23 -0400 Date: Mon, 24 May 2010 16:12:14 +0300 From: "Michael S. Tsirkin" To: avi@redhat.com, mtosatti@redhat.com, kvm@vger.kernel.org, ehabkost@redhat.com Subject: [PATCH] make-release: misc fixes Message-ID: <20100524131214.GA5872@redhat.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 24 May 2010 13:16:29 +0000 (UTC) diff --git a/kvm/scripts/make-release b/kvm/scripts/make-release index 11d9c27..fdc402b 100755 --- a/kvm/scripts/make-release +++ b/kvm/scripts/make-release @@ -1,7 +1,7 @@ #!/bin/bash -e usage() { - echo "usage: $0 [--upload] [--formal] commit [name]" + echo "usage: $0 [--upload] [--formal] commit [name] [tarball]" exit 1 } @@ -12,7 +12,7 @@ formal= releasedir=~/sf-release [[ -z "$TMP" ]] && TMP="/tmp" -tmpdir="$TMP/qemu-kvm-make-release.$$" +tmpdir=`mktemp -d --tmpdir="$TMP" qemu-kvm-make-release.XXXXXXXXXX` while [[ "$1" = -* ]]; do opt="$1" shift @@ -40,9 +40,15 @@ if [[ -z "$name" ]]; then name="$commit" fi -tarball="$releasedir/$name.tar" +tarball="$3" +if [[ -z "$tarball" ]]; then + tarball="$releasedir/$name.tar.gz" +fi +#strip trailing .gz if any +tarball=${tarball/%.gz/} cd "$(dirname "$0")"/../.. +mkdir -p "$(dirname "$tarball")" git archive --prefix="$name/" --format=tar "$commit" > "$tarball" mkdir -p "$tmpdir" @@ -59,6 +65,7 @@ if [[ -n "$formal" ]]; then rm -rf "$tmpdir" fi +rm -f "$tarball.gz" gzip -9 "$tarball" tarball="$tarball.gz"