improve scripts/make-release
PATCH 1/1 improve scripts/make-release
'make dist' creates a tarball for the current checkout.
'make qemu-${version}.tar.bz2' creates a tarball for git tag v${version}.
--- Makefile | 5 ++--- scripts/make-release | 8 +++++++- 2 files changed, 9 insertions(+), 4 deletions(-)
Makefile +2 -3
@@ -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,%,$@)"
scripts/make-release +7 -1
@@ -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
Signature · 1 line
1.7.1
Quoted 11 lines · 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 <[email protected]>--- Makefile | 5 ++--- scripts/make-release | 8 +++++++- 2 files changed, 9 insertions(+), 4 deletions(-)+++ b/scripts/make-release
scripts/make-release line 15
Quoted 4 lines
scripts/make-release +1
-0@@ -12,11 +12,17 @@ src="$1" version="$2" +if test "$version" = ""; then
test ! "$version"
is less typing, and still POSIX compliant.
scripts/make-release line 17
Quoted 2 lines
scripts/make-release +2
-0+ 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:
Signature · 2 lines
Eric Blake [email protected] +1-919-301-3266 Libvirt virtualization library http://libvirt.org