From a2bb90a08cb3b64dd815d762ffde2312582a6ec9 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 12 Jun 2009 09:59:52 +0200 Subject: 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 --- scripts/setlocalversion | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'scripts/setlocalversion') 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 -- cgit v1.2.3