From 4b6723b8e63518b064a1a168fba890ef6e792733 Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Thu, 2 Jun 2022 16:03:24 +0200 Subject: [PATCH] Added compute_hash() and compute_version() --- read_config | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/read_config b/read_config index 6094e0f..c2923e8 100755 --- a/read_config +++ b/read_config @@ -6,6 +6,10 @@ source ./general_utils if [ ${read_config_sourced:-1} = "1" ]; then # include only once readonly read_config_sourced=${BASH_SOURCE[0]} + + readonly MAJOR="0" + readonly MINOR="1" + readonly PATCH="0" readonly DATEFLAGS="+%Y.%m.%dT%H.%M.%S" readonly STRIPCOMMENTS='sed -e s/#.*$//g' @@ -19,8 +23,6 @@ if [ ${read_config_sourced:-1} = "1" ]; then # include only once readonly UPDATEPSAEND=./.updatepsa/end readonly PROGRAM=`basename $0` - readonly VERSION="0.8.0" - readonly WORKSPACE_DIR=workspace WORKING_DIRECTORY=${WORKING_DIRECTORY:-$UPDATEPSAHOME} @@ -83,12 +85,24 @@ if [ ${read_config_sourced:-1} = "1" ]; then # include only once readonly ZONE_GROUPS=(${__zone_groups[@]}) assert_a ZONE_GROUPS + return 0 } ############################################################################### ########################## parsing with jq finished ########################### ############################################################################### + compute_hash () { + # TODO: wie genau soll der hash-wert berechnet werden ? + HASH="12345abc" + # HASH_="67890def" + echo $HASH + } + + compute_version () { + VERSION="$MAJOR.$MINOR.$PATCH+$CUSTOMER_LOCATION-$(compute_hash)" + } + check_sanity_of_repository () { local func="${FUNCNAME[0]}" @@ -267,6 +281,9 @@ if [ ${read_config_sourced:-1} = "1" ]; then # include only once log_debug "$tab$tab ${KNOWN_FILES[$i]}" done log_debug "sanity of ${CUSTOMER_REPOSITORY_PATH} OK" + + # compute version string for current (i.e. previous) version + compute_version return 0 }