diff --git a/contrib/masterfiles-stage/masterfiles-stage.sh b/contrib/masterfiles-stage/masterfiles-stage.sh index 5f2a1913f5..a8de76138b 100755 --- a/contrib/masterfiles-stage/masterfiles-stage.sh +++ b/contrib/masterfiles-stage/masterfiles-stage.sh @@ -10,7 +10,7 @@ # Generated code modified and refined by Mike Weilgart usage() { -cat << EOF + cat <&2 ; exit 17 ; } +mydirname="$(dirname "$0")" +source "${mydirname}/common.sh" || { + echo "common.sh couldn't be sourced" >&2 + exit 17 +} [ -f "$PARAMS" ] || error_exit "ERROR: Missing '$PARAMS'" source "$PARAMS" - # The VCS_TYPE based function calls in the case switch below - # can count on the following environment variables to be set: - # - # MASTERDIR - # PARAMS - # VCS_TYPE (set in the PARAMS file) - # and additional vars set in PARAMS depending on the VCS_TYPE. +# The VCS_TYPE based function calls in the case switch below +# can count on the following environment variables to be set: +# +# MASTERDIR +# PARAMS +# VCS_TYPE (set in the PARAMS file) +# and additional vars set in PARAMS depending on the VCS_TYPE. case "${VCS_TYPE}" in - GIT_CFBS) - git_cfbs_masterstage $check_only - ;; - GIT_POLICY_CHANNELS) - git_stage_policy_channels $check_only - ;; - GIT) - git_masterstage $check_only - ;; - SVN) - svn_branch $check_only - ;; - *) - error_exit "Unknown VCS TYPE: '${VCS_TYPE}'." - ;; +GIT_CFBS) + git_cfbs_masterstage $check_only + ;; +GIT_POLICY_CHANNELS) + git_stage_policy_channels $check_only + ;; +GIT) + git_masterstage $check_only + ;; +SVN) + svn_branch $check_only + ;; +*) + error_exit "Unknown VCS TYPE: '${VCS_TYPE}'." + ;; esac