From f58a351c2528fafe256c1440f270f6ce10066767 Mon Sep 17 00:00:00 2001 From: Andriy Moroz Date: Wed, 13 Sep 2017 18:18:12 +0300 Subject: [PATCH 1/2] Add timestamp suffix to the dirty images version string This will allow to build different debug images without having to update BUILD_NUMBER variable before the build --- functions.sh | 2 +- slave.mk | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/functions.sh b/functions.sh index c73aeb45d649..01f645ca72c7 100644 --- a/functions.sh +++ b/functions.sh @@ -55,7 +55,7 @@ sonic_get_version() { local latest_tag=$(git describe --tags --abbrev=0) local branch_name=$(git rev-parse --abbrev-ref HEAD) if [ -n "$(git status --untracked-files=no -s --ignore-submodules)" ]; then - local dirty="-dirty" + local dirty="-dirty-$DIRTY_SUFFIX" fi BUILD_NUMBER=${BUILD_NUMBER:-0} ## Check if we are on tagged commit diff --git a/slave.mk b/slave.mk index caed4279dcc3..f23feb38ad1f 100644 --- a/slave.mk +++ b/slave.mk @@ -421,6 +421,8 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : .platform chmod +x sonic_debian_extension.sh, ) + DIRTY_SUFFIX="$(shell date +%s)" + export DIRTY_SUFFIX ./build_debian.sh "$(USERNAME)" "$(shell perl -e 'print crypt("$(PASSWORD)", "salt"),"\n"')" $(LOG) TARGET_MACHINE=$($*_MACHINE) IMAGE_TYPE=$($*_IMAGE_TYPE) ./build_image.sh $(LOG) From 321d95e24a3fa0f514abb6caedf29a39b66d0a8c Mon Sep 17 00:00:00 2001 From: Andriy Moroz Date: Thu, 21 Sep 2017 10:09:11 +0300 Subject: [PATCH 2/2] Changed timestamp format to YYYYMMDD.HHMMSS --- slave.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slave.mk b/slave.mk index f23feb38ad1f..9812fc4be9ff 100644 --- a/slave.mk +++ b/slave.mk @@ -421,7 +421,7 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : .platform chmod +x sonic_debian_extension.sh, ) - DIRTY_SUFFIX="$(shell date +%s)" + DIRTY_SUFFIX="$(shell date +%Y%m%d\.%H%M%S)" export DIRTY_SUFFIX ./build_debian.sh "$(USERNAME)" "$(shell perl -e 'print crypt("$(PASSWORD)", "salt"),"\n"')" $(LOG) TARGET_MACHINE=$($*_MACHINE) IMAGE_TYPE=$($*_IMAGE_TYPE) ./build_image.sh $(LOG)