diff options
author | Nico Schottelius <nico-linuxsetlocalversion@schottelius.org> | 2009-06-12 09:59:52 +0200 |
---|---|---|
committer | Sam Ravnborg <sam@ravnborg.org> | 2009-06-14 22:26:00 +0200 |
commit | a2bb90a08cb3b64dd815d762ffde2312582a6ec9 (patch) | |
tree | 469e2ca62aec1fc1764fb2f55dc8a0650e4b8d42 /scripts/setlocalversion | |
parent | b2d8993026a26f4ece8c8b3f2e138d2ba8f18eaa (diff) | |
download | op-kernel-dev-a2bb90a08cb3b64dd815d762ffde2312582a6ec9.zip op-kernel-dev-a2bb90a08cb3b64dd815d762ffde2312582a6ec9.tar.gz |
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/setlocalversion')
-rwxr-xr-x | scripts/setlocalversion | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/setlocalversion b/scripts/setlocalversion index 0079047..46989b8 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 |