1
0
Fork 0

kbuild: fix delay in setlocalversion on readonly source

Do not update index on read only media.
Idea published by Christian Kujau <lists@nerdbynature.de>.

Cc: Nico Schottelius <nico@ikn.schottelius.org>
Cc: Christian Kujau <lists@nerdbynature.de>
hifive-unleashed-5.1
Nico Schottelius 2009-06-12 09:59:52 +02:00 committed by Sam Ravnborg
parent b2d8993026
commit a2bb90a08c
1 changed files with 4 additions and 2 deletions

View File

@ -39,8 +39,10 @@ if head=`git rev-parse --verify --short HEAD 2>/dev/null`; then
printf -- '-svn%s' "`git svn find-rev $head`"
fi
# Are there uncommitted changes?
git update-index --refresh --unmerged > /dev/null
# Update index only on r/w media
[ -w . ] && git update-index --refresh --unmerged > /dev/null
# Check for uncommitted changes
if git diff-index --name-only HEAD | grep -v "^scripts/package" \
| read dummy; then
printf '%s' -dirty