X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=bin%2Fautobuilder;h=478cf4f615ee805fb13e1e886851f7a9c199baf4;hb=baa473a30728890e5e350d8765d661ebcfbcf268;hp=6efee13c9d40d79475e5e0ff4bb668517813ec7f;hpb=6e809983f54e24651328658548af7d3d32fe74d6;p=Autobuilder.git diff --git a/bin/autobuilder b/bin/autobuilder index 6efee13..478cf4f 100755 --- a/bin/autobuilder +++ b/bin/autobuilder @@ -3,7 +3,7 @@ # 2012-01-22, alex@barton.de # -MYNAME="`basename "$0"`" +MYNAME=$(basename "$0") # options FORCE="" @@ -33,15 +33,15 @@ MSG_PREFIX=" * " ERR_PREFIX=" ! " msg() { - echo "$MSG_PREFIX[`date +%H:%M:%S`] $MYNAME: $*" + echo "$MSG_PREFIX[$(date +%H:%M:%S)] $MYNAME: $*" } err() { - echo "$ERR_PREFIX[`date +%H:%M:%S`] $MYNAME: $*" >&2 + echo "$ERR_PREFIX[$(date +%H:%M:%S)] $MYNAME: $*" >&2 } prepare_git() { - cd "$BASE_DIR" + cd "$BASE_DIR" || return 1 if [ ! -d ".git" ]; then git clone "$REPOSITORY" . else @@ -54,7 +54,7 @@ prepare_git() { build() { msg "Building \"$NAME\" ..." - cd "$BASE_DIR" + cd "$BASE_DIR" || return 1 date >"$BASE_DIR/.$MYNAME.dirty" || return 1 if [ -x "./autogen.sh" ]; then @@ -70,33 +70,33 @@ build() { check() { msg "Checking \"$NAME\" ..." - cd "$BASE_DIR" + cd "$BASE_DIR" || return 1 eval make $MAKE_ARGS_CHECK $QUIETCMD } archive() { msg "Archiving \"$NAME\" ..." - cd "$BASE_DIR" + cd "$BASE_DIR" || return 1 eval make $MAKE_ARGS_DIST $QUIETCMD } publish() { msg "Publishing \"$NAME\" ..." - cd "$BASE_DIR" + cd "$BASE_DIR" || return 1 - archive=`ls -1rt *.tar.gz | tail -n 1` + archive=$(ls -1rt -- *.tar.gz | tail -n 1) if [ -z "$archive" ]; then err "No distribution archive found!?" return 1 fi mv "$archive" "$DEST_DIR"/ || return 1 - chmod a+rX "$DEST_DIR/`basename "$archive"`" + chmod a+rX "$DEST_DIR/$(basename "$archive")" rm -f "$archive" "$BASE_DIR/.$MYNAME.dirty" - msg "New \"$NAME\" archive: \"`basename "$archive"`\"" + msg "New \"$NAME\" archive: \"$(basename "$archive")\"" } @@ -108,7 +108,7 @@ publish() { # read in and process projects in autobuild.d directory for file in "$AUTOBUILDER_D_DIR"/*; do - file_name="`basename "$file"`" + file_name="$(basename "$file")" # defaults NAME="" @@ -157,10 +157,11 @@ for file in "$AUTOBUILDER_D_DIR"/*; do case "$TYPE" in "git") prepare_git - [ $? -eq 9 \ - -a -z "$FORCE" \ - -a ! -e "$BASE_DIR/.$MYNAME.dirty" ] \ - && continue + if [ $? -eq 9 ] \ + && [ -z "$FORCE" ] \ + && [ ! -e "$BASE_DIR/.$MYNAME.dirty" ]; then + continue + fi ;; esac