summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorNico Schottelius <nico-linuxsetlocalversion@schottelius.org>2009-06-12 09:59:52 +0200
committerSam Ravnborg <sam@ravnborg.org>2009-06-14 22:26:00 +0200
commita2bb90a08cb3b64dd815d762ffde2312582a6ec9 (patch)
tree469e2ca62aec1fc1764fb2f55dc8a0650e4b8d42 /scripts
parentb2d8993026a26f4ece8c8b3f2e138d2ba8f18eaa (diff)
downloadtalos-obmc-linux-a2bb90a08cb3b64dd815d762ffde2312582a6ec9.tar.gz
talos-obmc-linux-a2bb90a08cb3b64dd815d762ffde2312582a6ec9.zip
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>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/setlocalversion6
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/setlocalversion b/scripts/setlocalversion
index 00790472f641..46989b88d734 100755
--- a/scripts/setlocalversion
+++ b/scripts/setlocalversion
@@ -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
OpenPOWER on IntegriCloud