From 23fd85f41470539304339fd7d030d8ff590d48de Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Sun, 5 Jan 2025 12:24:14 +0100 Subject: [PATCH] webbuild-sudo: fix defining builddir for %setup without -n argument --- webbuild/webbuild-sudo | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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