* [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
* Re: [Qemu-devel] [PATCH] improve scripts/make-release
2012-07-18 14:31 [Qemu-devel] [PATCH] improve scripts/make-release Gerd Hoffmann
@ 2012-07-18 14:41 ` Eric Blake
0 siblings, 0 replies; 2+ messages in thread
From: Eric Blake @ 2012-07-18 14:41 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 1234 bytes --]
On 07/18/2012 08:31 AM, Gerd Hoffmann wrote:
> '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(-)
> +++ b/scripts/make-release
> @@ -12,11 +12,17 @@
>
> src="$1"
> version="$2"
> +if test "$version" = ""; then
test ! "$version"
is less typing, and still POSIX compliant.
> + commit=$(git describe --long)
> + version="${commit#v}"
Sticking with my earlier theme started against Anthony's original
implementation of this script, in complaining about inconsistent shell
quoting styles, it might look nicer to favor minimal quoting:
commit=$(git describe --long)
version=${commit#v}
or maximal quoting:
commit="$(git describe --long)"
version="${commit#v}"
rather than an ad hoc mix. But as that is cosmetic, and does not impact
functionality, you have my:
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake eblake@redhat.com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 620 bytes --]
^ permalink raw reply [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).