containerd/patch/0058-containerd-use-git-commit-to-store-commit-ID.patch
liuzekun bada571c96 containerd: use git-commit to store commit ID
Signed-off-by: liuzekun <liuzekun@huawei.com>
2020-06-15 04:54:01 -04:00

27 lines
998 B
Diff

From fe8ce77e756f7f468ed65c8c42a9f91becabbf4e Mon Sep 17 00:00:00 2001
From: liuzekun <liuzekun@huawei.com>
Date: Wed, 10 Jun 2020 00:37:01 -0400
Subject: [PATCH] containerd: use git-commit to store commit ID
Signed-off-by: liuzekun <liuzekun@huawei.com>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 9e7f3ae..6011aa1 100644
--- a/Makefile
+++ b/Makefile
@@ -21,7 +21,7 @@ DESTDIR=/usr/local
# Used to populate variables in version package.
VERSION=$(shell echo version:)$(shell grep '^Version' ${ROOTDIR}/containerd.spec | sed 's/[^0-9.]*\([0-9.]*\).*/\1/').$(shell grep '^Release:' ${ROOTDIR}/containerd.spec | sed 's/[^0-9.]*\([0-9.]*\).*/\1/')
-REVISION=$(shell echo commit:)$(shell git rev-parse HEAD)$(shell if ! git diff --no-ext-diff --quiet --exit-code; then echo .m; fi)
+REVISION=$(shell cat ./git-commit | head -c 40)
ifneq "$(strip $(shell command -v go 2>/dev/null))" ""
GOOS ?= $(shell go env GOOS)
--
2.19.1