From: Nico Schottelius Date: Fri, 12 Jun 2009 07:59:52 +0000 (+0200) Subject: kbuild: fix delay in setlocalversion on readonly source X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a2bb90a08cb3b64dd815d762ffde2312582a6ec9;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.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