From 57412675b7a99df964755da564dfc2ba0610be81 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Sun, 29 Apr 2018 15:02:12 +0100 Subject: [PATCH] Update handling of .ottdrev-vc file in findversion.sh --- findversion.sh | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/findversion.sh b/findversion.sh index 6fd15813dd..18490543af 100755 --- a/findversion.sh +++ b/findversion.sh @@ -86,25 +86,20 @@ if [ -d "$ROOT_DIR/.git" ]; then elif [ -f "$ROOT_DIR/.ottdrev-vc" ]; then VERSION_DATA="`cat "$ROOT_DIR/.ottdrev-vc" | sed -n -e '1 p;'`" HASH_DATA="`cat "$ROOT_DIR/.ottdrev-vc" | sed -n -e '2 p;'`" - REV="`echo "$VERSION_DATA" | cut -f 1 -d' '`" - REV_NR="`echo "$VERSION_DATA" | cut -f 2 -d' '`" + VERSION="`echo "$VERSION_DATA" | cut -f 1 -d' '`" + ISODATE="`echo "$VERSION_DATA" | cut -f 2 -d' '`" MODIFIED="`echo "$VERSION_DATA" | cut -f 3 -d' '`" - CLEAN_REV="`echo "$VERSION_DATA" | cut -f 4 -d' '`" + HASH="`echo "$VERSION_DATA" | cut -f 4 -d' '`" if [ "$MODIFIED" = "2" ]; then - CLEAN_REV="`echo "$CLEAN_REV" | sed -e 's/M$//'`" + VERSION="`echo "$VERSION" | sed -e 's/M$//'`" fi - BRANCH="`echo "$REV" | sed -n -e "s|^${CLEAN_REV}M\?-\(.\+\)$|\1|p"`" - REV="$CLEAN_REV" if ! $ROOT_DIR/version_utils.sh -o; then MODIFIED="1" else CURRENT_HASH="`$ROOT_DIR/version_utils.sh -s`" if [ "$CURRENT_HASH" != "$HASH_DATA" ]; then MODIFIED="2" - if [ -n "$BRANCH" ]; then - BRANCH="$BRANCH-" - fi - BRANCH="${BRANCH}H`echo "$CURRENT_HASH" | cut -c 1-8`" + VERSION="${VERSION}-H`echo "$CURRENT_HASH" | cut -c 1-8`" fi fi elif [ -f "$ROOT_DIR/.ottdrev" ]; then