From 9d218a005a3efd5c8e42386164cced584dcd5903 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Thu, 8 Feb 2024 17:06:19 +0100 Subject: [PATCH] webbuild-sudo: fix parsing SPECFILE_BUILDDIR since rpmspec started expanding %setup macro --- webbuild/webbuild-sudo | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/webbuild/webbuild-sudo b/webbuild/webbuild-sudo index 34530e2..ac05c6a 100755 --- a/webbuild/webbuild-sudo +++ b/webbuild/webbuild-sudo @@ -88,10 +88,11 @@ if [ "$MODE" = "specinfo" ]; then done < ${ENVPREFIX}${WORKINGHOME}/RPM/SPECS/$PACKAGE.spec [ "$AUTOBUILDREQ_BEGIN" -a "$AUTOBUILDREQ_END" -a ! "$AUTOBUILDREQ_UNDONE" ] || \ echo "SPECVAR_CHECK_NOAUTOBUILDREQ=1" - $SUCMDPREFIX "rpmspec -P ${WORKINGHOME}/RPM/SPECS/$PACKAGE.spec > ${WORKINGHOME}/RPM/SPECS/$PACKAGE.spec.tmp 2>/dev/null" + # _setup: prevent %setup macro expansion + $SUCMDPREFIX "rpmspec -P ${WORKINGHOME}/RPM/SPECS/$PACKAGE.spec --define \"%setup _setup\" > ${WORKINGHOME}/RPM/SPECS/$PACKAGE.spec.tmp 2>/dev/null" if [ -e $SPECFILE.tmp ]; then echo "SPECVAR_Specfile=\"$SPECFILE\"" - BUILDDIR=`grep -m1 "^%setup.*-n " $SPECFILE.tmp | sed "s|.*-n \([^[:space:]]*\).*|\1|"` + BUILDDIR=`grep -m1 "^_setup.*-n " $SPECFILE.tmp | sed "s|.*-n \([^[:space:]]*\).*|\1|"` while read line; do set -- $line [ "$1" = "%package" -o "$1" = "%description" ] && break