[LEDE-DEV] [PATCH RFC] scripts/getver: append '+' char if there are local modifications

Rafał Miłecki zajec5 at gmail.com
Tue Nov 15 13:40:46 PST 2016


From: Rafał Miłecki <rafal at milecki.pl>

We already count amount of local git commits. This allows realizing if
user did any local changes based on his boot log or openwrt_release.

Signed-off-by: Rafał Miłecki <rafal at milecki.pl>
---
 scripts/getver.sh | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/scripts/getver.sh b/scripts/getver.sh
index e718485..30cd6e9 100755
--- a/scripts/getver.sh
+++ b/scripts/getver.sh
@@ -40,6 +40,10 @@ try_git() {
 			REV="${UPSTREAM_REV}+$((REV - UPSTREAM_REV))"
 		fi
 
+		if ! git diff-index --quiet HEAD; then
+			REV="$REV+"
+		fi
+
 		REV="${REV:+r$REV}"
 		;;
 	esac
-- 
2.10.1




More information about the Lede-dev mailing list