1
0
Fork 0

scripts: refetch scripts/setlocalversion from Linux 3.16

Now we have CONFIG_LOCALVERSION and CONFIG_LOCALVERSION_AUTO
in Kconfig so we can use scripts/setlocalversion without
any adjustment.  Copy it from Linux 3.16 as is.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
utp
Masahiro Yamada 2014-08-22 19:42:28 +09:00 committed by Tom Rini
parent e91c3c332b
commit a6f47d2434
1 changed files with 14 additions and 17 deletions

View File

@ -3,8 +3,10 @@
# This scripts adds local version information from the version # This scripts adds local version information from the version
# control systems git, mercurial (hg) and subversion (svn). # control systems git, mercurial (hg) and subversion (svn).
# #
# It was originally copied from the Linux kernel v3.2.0-rc4 and modified # If something goes wrong, send a mail the kernel build mailinglist
# to support the U-Boot build-system. # (see MAINTAINERS) and CC Nico Schottelius
# <nico-linuxsetlocalversion -at- schottelius.org>.
#
# #
usage() { usage() {
@ -41,7 +43,8 @@ scm_version()
fi fi
# Check for git and a git repo. # Check for git and a git repo.
if test -e .git && head=`git rev-parse --verify --short HEAD 2>/dev/null`; then if test -z "$(git rev-parse --show-cdup 2>/dev/null)" &&
head=`git rev-parse --verify --short HEAD 2>/dev/null`; then
# 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.
@ -69,12 +72,8 @@ scm_version()
printf -- '-svn%s' "`git svn find-rev $head`" printf -- '-svn%s' "`git svn find-rev $head`"
fi fi
# Update index only on r/w media
[ -w . ] && git update-index --refresh --unmerged > /dev/null
# Check for uncommitted changes # Check for uncommitted changes
if git diff-index --name-only HEAD | grep -v "^scripts/package" \ if git diff-index --name-only HEAD | grep -qv "^scripts/package"; then
| read dummy; then
printf '%s' -dirty printf '%s' -dirty
fi fi
@ -107,7 +106,7 @@ scm_version()
fi fi
# Check for svn and a svn repo. # Check for svn and a svn repo.
if rev=`svn info 2>/dev/null | grep '^Last Changed Rev'`; then if rev=`LANG= LC_ALL= LC_MESSAGES=C svn info 2>/dev/null | grep '^Last Changed Rev'`; then
rev=`echo $rev | awk '{print $NF}'` rev=`echo $rev | awk '{print $NF}'`
printf -- '-svn%s' "$rev" printf -- '-svn%s' "$rev"
@ -141,14 +140,12 @@ if $scm_only; then
exit exit
fi fi
#if test -e include/config/auto.conf; then if test -e include/config/auto.conf; then
# . include/config/auto.conf . include/config/auto.conf
#else else
# echo "Error: kernelrelease not valid - run 'make prepare' to update it" echo "Error: kernelrelease not valid - run 'make prepare' to update it"
# exit 1 exit 1
#fi fi
CONFIG_LOCALVERSION=
CONFIG_LOCALVERSION_AUTO=y
# localversion* files in the build and source directory # localversion* files in the build and source directory
res="$(collect_files localversion*)" res="$(collect_files localversion*)"