From: Nico Schottelius Date: Fri, 12 Jun 2009 07:59:52 +0000 (+0200) Subject: kbuild: fix delay in setlocalversion on readonly source X-Git-Tag: v2.6.31-rc1~335^2~9 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=a2bb90a08cb3b64dd815d762ffde2312582a6ec9;p=linux.git kbuild: fix delay in setlocalversion on readonly source Do not update index on read only media. Idea published by Christian Kujau . Cc: Nico Schottelius Cc: Christian Kujau --- 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