diff options
author | Nico Schottelius <nico-linuxsetlocalversion@schottelius.org> | 2009-06-12 03:59:52 -0400 |
---|---|---|
committer | Sam Ravnborg <sam@ravnborg.org> | 2009-06-14 16:26:00 -0400 |
commit | a2bb90a08cb3b64dd815d762ffde2312582a6ec9 (patch) | |
tree | 469e2ca62aec1fc1764fb2f55dc8a0650e4b8d42 /scripts/setlocalversion | |
parent | b2d8993026a26f4ece8c8b3f2e138d2ba8f18eaa (diff) |
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 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 | |||
39 | printf -- '-svn%s' "`git svn find-rev $head`" | 39 | printf -- '-svn%s' "`git svn find-rev $head`" |
40 | fi | 40 | fi |
41 | 41 | ||
42 | # Are there uncommitted changes? | 42 | # Update index only on r/w media |
43 | git update-index --refresh --unmerged > /dev/null | 43 | [ -w . ] && git update-index --refresh --unmerged > /dev/null |
44 | |||
45 | # Check for uncommitted changes | ||
44 | if git diff-index --name-only HEAD | grep -v "^scripts/package" \ | 46 | if git diff-index --name-only HEAD | grep -v "^scripts/package" \ |
45 | | read dummy; then | 47 | | read dummy; then |
46 | printf '%s' -dirty | 48 | printf '%s' -dirty |