diff --git a/webbuild/webbuild-sudo b/webbuild/webbuild-sudo index 408ba30..300db2a 100755 --- a/webbuild/webbuild-sudo +++ b/webbuild/webbuild-sudo @@ -93,10 +93,10 @@ if [ "$MODE" = "specinfo" ]; then echo "SPECVAR_Specfile=\"$SPECFILE\"" # Resolve builddir by parsing %setup macro or use default BUILDDIR_UNPARSED=`grep "^%setup" ${WORKINGHOME}/RPM/SPECS/$PACKAGE.spec | sed "s|.*-n \([^[:space:]]*\).*|\1|"` - if [ ! "$BUILDDIR_UNPARSED" ]; then + if [ "$BUILDDIR_UNPARSED/%setup" != "$BUILDDIR_UNPARSED" ]; then BUILDDIR_UNPARSED="$PACKAGE-%{version}" fi - BUILDDIR=`rpmspec -q --srpm --queryformat \"${BUILDDIR_UNPARSED}\" ${WORKINGHOME}/RPM/SPECS/$PACKAGE.spec` + BUILDDIR=`rpmspec -q --srpm --queryformat "${BUILDDIR_UNPARSED}" ${WORKINGHOME}/RPM/SPECS/$PACKAGE.spec` while read line; do set -- $line [ "$1" = "%package" -o "$1" = "%description" ] && break