[CRIU] [PATCH] make: Improve tar generation
Cyrill Gorcunov
gorcunov at openvz.org
Tue Mar 8 01:28:46 PST 2016
By default it generates archive name same
as a tag name, but Pavel requested to match
old scheme and strip off "v" prefix.
Reported-by: Pavel Emelyanov <xemul at virtuozzo.com>
Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
Makefile | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
index 7569387201cb..ce9e40b15a14 100644
--- a/Makefile
+++ b/Makefile
@@ -165,12 +165,17 @@ test: zdtm
$(Q) MAKEFLAGS= $(MAKE) -C test
PHONY += test
-tar-name := $(shell git tag -l v$(CRIU_VERSION))
-ifeq ($(tar-name),)
- tar-name := $(shell git describe)
+#
+# Generating tar requires tag matched CRIU_VERSION.
+# If not found then simply use GIT's describe with
+# "v" prefix stripped.
+head-name := $(shell git tag -l v$(CRIU_VERSION))
+ifeq ($(head-name),)
+ head-name := $(shell git describe)
endif
+tar-name := $(shell echo $(head-name) | sed -e 's/^v//g')
criu-$(tar-name).tar.bz2:
- git archive --format tar --prefix 'criu-$(tar-name)/' $(tar-name) | bzip2 > $@
+ git archive --format tar --prefix 'criu-$(tar-name)/' $(head-name) | bzip2 > $@
dist tar: criu-$(tar-name).tar.bz2
@true
.PHONY: dist tar
--
2.5.0
More information about the CRIU
mailing list