#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
#
# This scripts adds local version information from the version
# control systems git, mercurial (hg) and subversion (svn).
#
# If something goes wrong, send a mail the kernel build mailinglist
# (see MAINTAINERS) and CC Nico Schottelius
# <nico-linuxsetlocalversion -at- schottelius.org>.
#
#

usage() {
	echo "Usage: $0 [--save-scmversion] [srctree] [branch] [kmi-generation]" >&2
	exit 1
}

scm_only=false
srctree=.
android_release=
kmi_generation=
if test "$1" = "--save-scmversion"; then
	scm_only=true
	shift
fi
if test $# -gt 0; then
	srctree=$1
	shift
fi
if test $# -gt 0; then
	# Extract the Android release version. If there is no match, then return 255
	# and clear the var $android_release
	android_release=`echo "$1" | sed -e '/android[0-9]\{2,\}/!{q255}; \
		s/^\(android[0-9]\{2,\}\)-.*/\1/'`
	if test $? -ne 0; then
		android_release=
	fi
	shift

	if test $# -gt 0; then
		kmi_generation=$1
		[ $(expr $kmi_generation : '^[0-9]\+$') -eq 0 ] && usage
		shift
	fi
fi
if test $# -gt 0 -o ! -d "$srctree"; then
	usage
fi

scm_version()
{
	local short
	short=false

	cd "$srctree"
	if test -e .scmversion; then
		cat .scmversion
		return
	fi
	if test "$1" = "--short"; then
		short=true
	fi

	# Check for git and a git repo.
	if head=$(git rev-parse --verify HEAD 2>/dev/null); then

		if [ -n "$android_release" ] && [ -n "$kmi_generation" ]; then
			printf '%s' "-$android_release-$kmi_generation"
		elif [ -n "$android_release" ]; then
			printf '%s' "-$android_release"
		fi

		# 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.
		if [ -z "$(git describe --exact-match 2>/dev/null)" ]; then

			# If only the short version is requested, don't bother
			# running further git commands
			if $short; then
				echo "+"
				return
			fi
			# If we are past a tagged commit (like
			# "v2.6.30-rc5-302-g72357d5"), we pretty print it.
			if atag="$(git describe 2>/dev/null)"; then
				echo "$atag" | awk -F- '{printf("-%05d", $(NF-1))}'
			fi

			# Add -g and exactly 12 hex chars.
			printf '%s%s' -g "$(echo $head | cut -c1-12)"
		fi

		# Check for uncommitted changes.
		# This script must avoid any write attempt to the source tree,
		# which might be read-only.
		# You cannot use 'git describe --dirty' because it tries to
		# create .git/index.lock .
		# First, with git-status, but --no-optional-locks is only
		# supported in git >= 2.14, so fall back to git-diff-index if
		# it fails. Note that git-diff-index does not refresh the
		# index, so it may give misleading results. See
		# git-update-index(1), git-diff-index(1), and git-status(1).
		if {
			git --no-optional-locks status -uno --porcelain 2>/dev/null ||
			git diff-index --name-only HEAD
		} | read dummy; then
			printf '%s' -dirty
		fi
	fi
}

collect_files()
{
	local file res=

	for file; do
		case "$file" in
		*\~*)
			continue
			;;
		esac
		if test -e "$file"; then
			res="$res$(cat "$file")"
		fi
	done
	echo "$res"
}

if $scm_only; then
	if test ! -e .scmversion; then
		res=$(scm_version)
		echo "$res" >.scmversion
	fi
	exit
fi

if ! test -e include/config/auto.conf; then
	echo "Error: kernelrelease not valid - run 'make prepare' to update it" >&2
	exit 1
fi

# localversion* files in the build and source directory
res="$(collect_files localversion*)"
if test ! "$srctree" -ef .; then
	res="$res$(collect_files "$srctree"/localversion*)"
fi

# CONFIG_LOCALVERSION and LOCALVERSION (if set)
config_localversion=$(sed -n 's/^CONFIG_LOCALVERSION=\(.*\)$/\1/p' include/config/auto.conf)
res="${res}${config_localversion}${LOCALVERSION}"

# scm version string if not at a tagged commit
if grep -q "^CONFIG_LOCALVERSION_AUTO=y$" include/config/auto.conf; then
	# full scm version string
	res="$res$(scm_version)"
elif [ "${LOCALVERSION+set}" != "set" ]; then
	# If the variable LOCALVERSION is not set, append a plus
	# sign if the repository is not in a clean annotated or
	# signed tagged state (as git describe only looks at signed
	# or annotated tags - git tag -a/-s).
	#
	# If the variable LOCALVERSION is set (including being set
	# to an empty string), we don't want to append a plus sign.
	scm=$(scm_version --short)
	res="$res${scm:++}"
fi

# finally, add the abXXX number if BUILD_NUMBER is set
if test -n "${BUILD_NUMBER}"; then
	res="$res-ab${BUILD_NUMBER}"
fi

echo "$res"
