X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=lib%2Fbtr%2Fbtr.sh;h=96376efcfeba08ac79bf41d50d4a6ef8f925727a;hb=55181f92726b4306007e3bac012bbeff71ca4944;hp=2b79088d4ba597fa74482886de5af00e9786180a;hpb=3b00623fb5e4bc96e244eadb73cfba2bbc43462e;p=m6w6%2Fbtr diff --git a/lib/btr/btr.sh b/lib/btr/btr.sh index 2b79088..96376ef 100755 --- a/lib/btr/btr.sh +++ b/lib/btr/btr.sh @@ -1,28 +1,30 @@ #!/bin/sh function help { - echo "btr v0.2.0, (c) Michael Wallner " - echo - echo "Usage: $(basename $0) [-hv] [] " - echo - echo " -h, --help Display this help" - echo " -v, --verbose Be more verbose" - echo - echo " Options:" - echo " -s, --source= Use the specified source ruleset" - echo " -b, --build= Use the specified build ruleset" - echo " -r, --report= Use the specifued report ruleset" - echo " -B, --branch= Checkout this branch" - echo " -D, --directory= Use this directory as work root" - echo " -S, --suffix= Append suffix to the build name" - echo " -C, --configure= Define \$CONFIGURE options" - echo - echo " Rulesets:" - echo " source: git, svn" - echo " build: php, pecl" - echo " report: mail" - echo - exit + echo "btr v0.2.0, (c) Michael Wallner " + echo + echo "Usage: $(basename $0) [-hv] [] " + echo + echo " -h, --help Display this help" + echo " -v, --verbose Be more verbose" + echo + echo " Options:" + echo " -s, --source= Use the specified source ruleset" + echo " -b, --build= Use the specified build ruleset" + echo " -r, --report= Use the specifued report ruleset" + echo " -B, --branch= Checkout this branch" + echo " -D, --directory= Use this directory as work root" + echo " -S, --suffix= Append suffix to the build name" + echo " -C, --configure= Define \$CONFIGURE options" + echo + echo " Rulesets:" + for ruleset in source build report + do + printf " %10s: %s\n" $ruleset \ + "$(find "$LIBDIR/$ruleset" -name '*.mk' -exec basename {} .mk \; | sort | xargs)" + done + echo + exit } function parseopts { @@ -82,7 +84,7 @@ function parseopts { ;; -b|--build) case "$2" in - php|pecl) + *) BUILD_RULES="$2" ;; esac @@ -90,7 +92,7 @@ function parseopts { ;; -r|--report) case "$2" in - mail) + *) REPORT_RULES="$2" ;; esac @@ -142,7 +144,7 @@ function setup { export CONFIG_REPORT="btr+config-$BUILD-$DATE" export BUILD_REPORT="btr+build-$BUILD-$DATE" export TEST_REPORT="btr+tests-$BUILD-$DATE" - export LAST_REPORT=$(basename $(ls -t "$BTRDIR/btr+tests-$BUILD"* | tail -n1)) + export LAST_REPORT=$(basename $(ls -t "$BTRDIR/btr+tests-$BUILD"* 2>/dev/null | tail -n1) 2>/dev/null) export REPORT="" }