X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=compile.sh;h=8aa5607618e1874c2b6f2027ec9b1f841620e5b5;hb=refs%2Fheads%2Fmaster;hp=b519f0a95875eb73922cd28d14bd65d75f867fa8;hpb=50ef2204f30be5295997dde4eb86267fddef2c2a;p=packages%2Frpm-build-tools.git diff --git a/compile.sh b/compile.sh old mode 100644 new mode 100755 index b519f0a..8aa5607 --- a/compile.sh +++ b/compile.sh @@ -3,8 +3,8 @@ # i use it a lot! # # Usage: -# do do only %build stage (ie after %prep has been done), for example after -# modifying some sources for more complicated specs wholse %build is not just +# make only %build stage (i.e. after %prep has been done), for example after +# modifying some sources for more complicated specs whose %build is not just # %{__make}: # SPECS$ ./compile.sh kdelibs.spec # @@ -12,5 +12,14 @@ # # -glen 2005-03-03 -set -x -exec ./builder -ncs -nn --short-circuit -bc "$@" +dir=$(dirname "$0") +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 "$@"