Skip to content

Commit 1fd773f

Browse files
Append dirty if contains local changes
Signed-off-by: marian-pritsak <[email protected]>
1 parent bc2e3a4 commit 1fd773f

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ DOCKER_BUILD = docker build --no-cache \
3838
-f slave.mk \
3939
PLATFORM=$(PLATFORM) \
4040
BUILD_NUMBER=$(BUILD_NUMBER) \
41+
ENABLE_DHCP_GRAPH_SERVICE=$(ENABLE_DHCP_GRAPH_SERVICE) \
4142
$@
4243

4344
sonic-slave-build :

functions.sh

+7-4
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,14 @@ docker_try_rmi() {
5353
sonic_get_version() {
5454
local describe=$(git describe --tags)
5555
local latest_tag=$(git describe --tags --abbrev=0)
56-
BUILD_NUMBER=${BUILD_NUMBER:-dev}
57-
## Cehck if we are on tagged commit
56+
if [ -n "$(git status --untracked-files=no -s --ignore-submodules)" ]; then
57+
local dirty="-dirty"
58+
fi
59+
BUILD_NUMBER=${BUILD_NUMBER:-0}
60+
## Check if we are on tagged commit
5861
if [ "$describe" == "$latest_tag" ]; then
59-
echo "$latest_tag"
62+
echo "${latest_tag}${dirty}"
6063
else
61-
echo "${latest_tag}.${BUILD_NUMBER}-$(git rev-parse --short HEAD)"
64+
echo "${latest_tag}.${BUILD_NUMBER}${dirty:--$(git rev-parse --short HEAD)}"
6265
fi
6366
}

0 commit comments

Comments
 (0)