mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-22 09:58:09 +00:00
Makefile: suppress git describe warnings
This should fix errors on build envs, where git tags haven't been fetched. I.e, Travis-ci does not fetch tags before building a project, wich results in: ---> Running in 0d63a3d28a7a fatal: No names found, cannot describe anything. fatal: No names found, cannot describe anything. make[1]: Entering directory '/criu' The other way is to fetch tags on `git describe` failure, but it that way has two cons: - it will change user's git (and I'm not sure it's right); - we need not only fetch tags in that case, but also remotes, as otherwise it will fail with "fatal: No tags can describe <hash>": https://travis-ci.org/0x7f454c46/criu/jobs/133362045#L1748 Cc: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com> Acked-by: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
parent
39cbd91672
commit
fa8b12a1ec
14
Makefile
14
Makefile
@ -141,8 +141,9 @@ include Makefile.versions
|
|||||||
|
|
||||||
VERSION_HEADER := $(SRC_DIR)/criu/include/version.h
|
VERSION_HEADER := $(SRC_DIR)/criu/include/version.h
|
||||||
GITID_FILE := .gitid
|
GITID_FILE := .gitid
|
||||||
GITID := $(shell if [ -d ".git" ]; then git describe; fi)
|
GITID := $(shell if [ -d ".git" ]; then git describe --always; fi)
|
||||||
|
|
||||||
|
# Git repository wasn't inited in CRIU folder
|
||||||
ifeq ($(GITID),)
|
ifeq ($(GITID),)
|
||||||
GITID := 0
|
GITID := 0
|
||||||
else
|
else
|
||||||
@ -248,7 +249,16 @@ test: zdtm
|
|||||||
# "v" prefix stripped.
|
# "v" prefix stripped.
|
||||||
head-name := $(shell git tag -l v$(CRIU_VERSION))
|
head-name := $(shell git tag -l v$(CRIU_VERSION))
|
||||||
ifeq ($(head-name),)
|
ifeq ($(head-name),)
|
||||||
head-name := $(shell git describe)
|
head-name := $(shell git describe 2>/dev/null)
|
||||||
|
endif
|
||||||
|
# If no git tag could describe current commit,
|
||||||
|
# use pre-defined CRIU_VERSION with GITID (if any).
|
||||||
|
ifeq ($(head-name),)
|
||||||
|
ifneq ($(GITID),)
|
||||||
|
head-name := $(CRIU_VERSION)-$(GITID)
|
||||||
|
else
|
||||||
|
head-name := $(CRIU_VERSION)
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
tar-name := $(shell echo $(head-name) | sed -e 's/^v//g')
|
tar-name := $(shell echo $(head-name) | sed -e 's/^v//g')
|
||||||
criu-$(tar-name).tar.bz2:
|
criu-$(tar-name).tar.bz2:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user