containerd: fix version number wrong

(cherry picked from commit 34bbfdb93d4fb6f94f70b6abedd832f32d869670)
This commit is contained in:
zhongjiawei 2022-11-16 14:45:28 +08:00 committed by openeuler-sync-bot
parent 0eee35ff66
commit 2722620407
3 changed files with 47 additions and 1 deletions

View File

@ -2,7 +2,7 @@
%global debug_package %{nil}
Version: 1.2.0
Name: containerd
Release: 204
Release: 205
Summary: An industry-standard container runtime
License: ASL 2.0
URL: https://containerd.io
@ -21,6 +21,7 @@ low-level storage and network attachments, etc.
%setup -c -n containerd
%build
echo %{VERSION}.%{RELEASE} > containerd_version
./apply-patch
GO_BUILD_PATH=$PWD/_build
@ -41,6 +42,12 @@ install -p -m 755 bin/containerd-shim $RPM_BUILD_ROOT/%{_bindir}/containerd-shim
%{_bindir}/containerd-shim
%changelog
* Wed Nov 16 2022 zhongjiawei<zhongjiawei1@huawei.com> - 1.2.0-205
- Type:bugfix
- ID:NA
- SUG:NA
- DESC: fix version number wrong
* Thu Sep 22 2022 zhongjiawei<zhongjiawei1@huawei.com> - 1.2.0-204
- Type:bugfix
- ID:NA

View File

@ -0,0 +1,38 @@
From 0c10761f1cb7a5d9d7d98c68891f0b67cbbee9f3 Mon Sep 17 00:00:00 2001
From: zhongjiawei <zhongjiawei1@huawei.com>
Date: Wed, 16 Nov 2022 14:40:08 +0800
Subject: [PATCH] containerd: fix version number wrong
---
Makefile | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
index 1303770..44eeefc 100644
--- a/Makefile
+++ b/Makefile
@@ -20,8 +20,8 @@ ROOTDIR=$(dir $(abspath $(lastword $(MAKEFILE_LIST))))
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)
+VERSION=$(shell echo version:)$(shell cat ./containerd_version)
+REVISION=$(shell cat ./git-commit | head -c 40)
ifneq "$(strip $(shell command -v go 2>/dev/null))" ""
GOOS ?= $(shell go env GOOS)
@@ -181,8 +181,8 @@ bin/%: cmd/% FORCE
bin/containerd-shim: cmd/containerd-shim FORCE # set !cgo and omit pie for a static shim build: https://github.com/golang/go/issues/17789#issuecomment-258542220
@echo "$(WHALE) bin/containerd-shim"
CGO_ENABLED=1 \
- CGO_CFLAGS="-fstack-protector-strong -fPIE -D_FORTIFY_SOURCE=2 -O2" \
- CGO_CPPFLAGS="-fstack-protector-strong -fPIE -D_FORTIFY_SOURCE=2 -O2" \
+ CGO_CFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2" \
+ CGO_CPPFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2" \
CGO_LDFLAGS_ALLOW='-Wl,-z,relro,-z,now' \
CGO_LDFLAGS="-Wl,-z,relro,-z,now -Wl,-z,noexecstack" \
go build -buildmode=pie ${GO_BUILD_FLAGS} -o bin/containerd-shim ${SHIM_GO_LDFLAGS} ${GO_TAGS} ./cmd/containerd-shim
--
2.30.0

View File

@ -94,4 +94,5 @@ patch/0089-schema1-reject-ambiguous-documents.patch
patch/0090-containerd-put-get-pid-lock-after-set-process-exited-to-.patch
patch/0091-containerd-add-CGO-sercurity-build-options.patch
patch/0092-containerd-Limit-the-response-size-of-ExecSync.patch
patch/0093-containerd-fix-version-number-wrong.patch