X-Git-Url: https://git.pld-linux.org/?a=blobdiff_plain;f=compile.sh;h=8aa5607618e1874c2b6f2027ec9b1f841620e5b5;hb=fb64f88ce1cae815085ad1bbba486d80cce254a1;hp=36dcbe6f58c392c265b1b4f49dbd28ac324b496f;hpb=841d39d880f58d45d9f3234e71c52cead7a5dc54;p=packages%2Frpm-build-tools.git diff --git a/compile.sh b/compile.sh old mode 100644 new mode 100755 index 36dcbe6..8aa5607 --- a/compile.sh +++ b/compile.sh @@ -13,5 +13,13 @@ # -glen 2005-03-03 dir=$(dirname "$0") -set -x +if [ $# = 0 ]; then + # if no spec name passed, glob *.spec + set -- *.spec + if [ ! -f "$1" -o $# -gt 1 ]; then + echo >&2 "ERROR: Too many or too few .spec files found" + echo >&2 "Usage: ${0##*/} PACKAGE.spec" + exit 1 + fi +fi exec $dir/builder --no-md5 -ncs -nn --short-circuit -bc "$@"