From e3a8a11f7fdc64a560810cf021080c61c7d69dc5 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 8 Aug 2018 09:45:48 +0200 Subject: Document submit-git --- brep/submit/submit.bash.in | 36 ++++++++++-------------------------- 1 file changed, 10 insertions(+), 26 deletions(-) (limited to 'brep/submit/submit.bash.in') diff --git a/brep/submit/submit.bash.in b/brep/submit/submit.bash.in index d6f0258..8315315 100644 --- a/brep/submit/submit.bash.in +++ b/brep/submit/submit.bash.in @@ -2,10 +2,6 @@ # copyright : Copyright (c) 2014-2018 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file -# @@ Should we make this module besides defining utility functions to also -# parse and remove from args the common arguments (directory)? -# - if [ "$brep_submit" ]; then return 0 else @@ -16,11 +12,14 @@ fi # Diagnostics. # -self="$(basename $0)" -# Result reference (assigned later). +# We expect the user to set the verbose variable either to true or empty +# (false). # -reference= +if [ ! -v verbose ]; then + echo "variable 'verbose' is not set" 2>&1 + exit 1 +fi # Normally the brep module's log record looks like this: # @@ -29,6 +28,9 @@ reference= # We will use the (almost) same format for our diagnostics (redirected to the # Apache's error_log) so it can easily be attributed to the brep module. # +info_self="$(basename $0)" +info_ref="$(basename "${!#/}")" # Last argument is the submission directory. + function info () # { local severity="$1" @@ -41,30 +43,12 @@ function info () # ts= fi - echo "[$ts] [brep:$severity] [ref $reference] [$self]: $*" 1>&2; + echo "[$ts] [brep:$severity] [ref $info_ref] [$info_self]: $*" 1>&2; } function error () { info "error" "$*"; exit 1; } function trace () { if [ "$verbose" ]; then info "info" "$*"; fi } -# Submission data directory. -# -# @@ Doesn't comply with implementation assuming that directory comes before -# submit-handler-arguments. Can we change the doc? -# -dir="${1%/}" # @@ Call it directory? -shift - -if [ -z "$dir" ]; then - error "$usage" -fi - -if [ ! -d "$dir" ]; then - error "'$dir' does not exist or is not a directory" -fi - -reference="$(basename $dir)" - # Serialize one manifest name/value pair. # function serialize () # -- cgit v1.1