From 7a77d03c7e013a4286e9a13aa6f26a73e79ed157 Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Tue, 7 Jun 2022 22:32:46 +0200 Subject: [PATCH] Add some vars --- read_config | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/read_config b/read_config index 7cdc2b0..1eacaf8 100755 --- a/read_config +++ b/read_config @@ -22,6 +22,9 @@ if [ ${read_config_sourced:-1} = "1" ]; then # include only once readonly UPDATEPSABEGIN=./.updatepsa/begin readonly UPDATEPSAEND=./.updatepsa/end + readonly OPKG_CMDS_TMP=/tmp/opkg_commands + readonly GIT_PULL_TMP=/tmp/git_pull + readonly PROGRAM=`basename $0` readonly WORKSPACE_DIR=workspace @@ -97,13 +100,15 @@ if [ ${read_config_sourced:-1} = "1" ]; then # include only once compute_hash () { if cd_customer_repository; then local hash="" - if [[ -z $1 ]]; then + if [[ -z "$1" ]]; then hash=$(git log -n 1 --pretty=format:%H) else - hash=$(git log -n 1 --pretty=format:%H -- $1) + hash=$(git hash-object "$1") fi - echo ${hash:0:10} # return the first 10 hex characters + cd_home ; echo ${hash:0:10} # return the first 10 hex characters + return 0 fi + return 1 } compute_version () {