diff options
author | Nico Schottelius <nico-linuxsetlocalversion@schottelius.org> | 2009-06-12 11:59:52 +0400 |
---|---|---|
committer | Sam Ravnborg <sam@ravnborg.org> | 2009-06-15 00:26:00 +0400 |
commit | a2bb90a08cb3b64dd815d762ffde2312582a6ec9 (patch) | |
tree | 469e2ca62aec1fc1764fb2f55dc8a0650e4b8d42 /scripts | |
parent | b2d8993026a26f4ece8c8b3f2e138d2ba8f18eaa (diff) | |
download | linux-a2bb90a08cb3b64dd815d762ffde2312582a6ec9.tar.xz |
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-x | scripts/setlocalversion | 6 |
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 |