From 67fe703ff5dfd7a02dc94e8b746565819a5ed42b Mon Sep 17 00:00:00 2001 From: Chen Taotao Date: Tue, 22 Nov 2022 01:05:21 -0800 Subject: [PATCH] runtime-rs: remove the version number from the commit display message The displayed commit message and version message are partially duplicated. Remove the version number from the commit display message. Fixes:#5735 Signed-off-by: Chen Taotao --- src/runtime-rs/Makefile | 7 ++----- src/runtime-rs/crates/shim/src/bin/main.rs | 2 +- src/runtime-rs/crates/shim/src/config.rs.in | 1 - 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/runtime-rs/Makefile b/src/runtime-rs/Makefile index a78d41770f..1050c70ed6 100644 --- a/src/runtime-rs/Makefile +++ b/src/runtime-rs/Makefile @@ -290,9 +290,6 @@ COMMIT_NO := $(shell git rev-parse HEAD 2>/dev/null || true) COMMIT := $(if $(shell git status --porcelain --untracked-files=no 2>/dev/null || true),${COMMIT_NO}-dirty,${COMMIT_NO}) COMMIT_MSG = $(if $(COMMIT),$(COMMIT),unknown) -# Exported to allow cargo to see it -export VERSION_COMMIT := $(if $(COMMIT),$(VERSION)-$(COMMIT),$(VERSION)) - EXTRA_RUSTFEATURES := ifneq ($(EXTRA_RUSTFEATURES),) @@ -322,8 +319,8 @@ GENERATED_REPLACEMENTS= \ CONTAINERD_RUNTIME_NAME \ RUNTIME_VERSION \ BINDIR \ - COMMIT \ - VERSION_COMMIT + COMMIT + GENERATED_FILES := GENERATED_FILES += $(GENERATED_CODE) diff --git a/src/runtime-rs/crates/shim/src/bin/main.rs b/src/runtime-rs/crates/shim/src/bin/main.rs index 3583f9f8ac..1ee9fc2033 100644 --- a/src/runtime-rs/crates/shim/src/bin/main.rs +++ b/src/runtime-rs/crates/shim/src/bin/main.rs @@ -99,7 +99,7 @@ fn show_version(err: Option) { config::PROJECT_NAME, config::CONTAINERD_RUNTIME_NAME, config::RUNTIME_VERSION, - config::RUNTIME_VERSION_COMMIT, + config::RUNTIME_GIT_COMMIT, ); if let Some(err) = err { diff --git a/src/runtime-rs/crates/shim/src/config.rs.in b/src/runtime-rs/crates/shim/src/config.rs.in index 4c1b9c562d..f4e01c9e2f 100644 --- a/src/runtime-rs/crates/shim/src/config.rs.in +++ b/src/runtime-rs/crates/shim/src/config.rs.in @@ -9,7 +9,6 @@ pub const PROJECT_NAME: &str = "@PROJECT_NAME@"; pub const RUNTIME_VERSION: &str = "@RUNTIME_VERSION@"; -pub const RUNTIME_VERSION_COMMIT: &str = "@VERSION_COMMIT@"; pub const RUNTIME_GIT_COMMIT: &str = "@COMMIT@"; pub const RUNTIME_NAME: &str = "@RUNTIME_NAME@"; pub const CONTAINERD_RUNTIME_NAME: &str = "@CONTAINERD_RUNTIME_NAME@";