stop using git tags for LOCALVERSION

This can screw up reproducible builds.
This commit is contained in:
Daniel Micay 2021-05-14 02:45:37 -04:00 committed by Kreciorek
parent 7ff2e6fb4f
commit f270792105

View file

@ -72,7 +72,7 @@ scm_version()
# If we are at a tagged commit (like "v2.6.30-rc6"), we ignore # If we are at a tagged commit (like "v2.6.30-rc6"), we ignore
# it, because this version is defined in the top level Makefile. # it, because this version is defined in the top level Makefile.
if [ -z "$(git describe --exact-match 2>/dev/null)" ]; then #if [ -z "$(git describe --exact-match 2>/dev/null)" ]; then
# If only the short version is requested, don't bother # If only the short version is requested, don't bother
# running further git commands # running further git commands
@ -91,16 +91,16 @@ scm_version()
# --abbrev=12 ensures a minimum of 12, and the # --abbrev=12 ensures a minimum of 12, and the
# awk substr() then picks the 'g' and first 12 # awk substr() then picks the 'g' and first 12
# hex chars. # hex chars.
if atag="$(git describe --abbrev=12 2>/dev/null)"; then #if atag="$(git describe --abbrev=12 2>/dev/null)"; then
echo "$atag" | awk -F- '{printf("-%05d-%s", $(NF-1),substr($(NF),0,13))}' #echo "$atag" | awk -F- '{printf("-%05d-%s", $(NF-1),substr($(NF),0,13))}'
# If we don't have a tag at all we print -g{commitish}, # If we don't have a tag at all we print -g{commitish},
# again using exactly 12 hex chars. # again using exactly 12 hex chars.
else #else
head="$(echo $head | cut -c1-12)" head="$(echo $head | cut -c1-12)"
printf '%s%s' -g $head printf '%s%s' -g $head
fi #fi
fi #fi
# Is this git on svn? # Is this git on svn?
if git config --get svn-remote.svn.url >/dev/null; then if git config --get svn-remote.svn.url >/dev/null; then