From 2dd4d2632d10dd3ea668b80a2ad7b829967c3714 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Tue, 10 Jun 2014 00:19:26 +0200 Subject: [PATCH] webbuild-cgi: fix rpmbuild -bs and other rpmbuild calls by passing correct %_topdir according to environment --- webbuild/webbuild-cgi | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/webbuild/webbuild-cgi b/webbuild/webbuild-cgi index 0c61bac..9d15e31 100755 --- a/webbuild/webbuild-cgi +++ b/webbuild/webbuild-cgi @@ -1044,7 +1044,7 @@ if [ "$REQUEST" = "prepare" -o "$REQUEST" = "updatespec" -o "$REQUEST" = "speccr [ $RET -eq 0 ] && { social_log "SUSER=$USER SEMAIL=$USER_EMAIL STARGET=developers STEXT=\"is working on $PACKAGE new package in `print_environment_descr $ENVIRONMENT` environment\" STIME=`date +%s`" # prepare - $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "rpmbuild -bp $PACKAGE.spec --nodeps" + $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "rpmbuild -bp $PACKAGE.spec --nodeps --define=\"_topdir $SPECVAR_WORKINGHOME/RPM\"" RET=$? if [ $RET -eq 0 ]; then REQUEST_NEXT="showbuilddocs" @@ -1738,7 +1738,7 @@ case $REQUEST in fi ;; "autospecupdatescheck") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "$AUTOSPEC_CMD -u $PACKAGE -a2"; RET=$? ;; - "rpmprepare") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "rpmbuild -bp $PACKAGE.spec --nodeps"; RET=$? ;; + "rpmprepare") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "rpmbuild -bp $PACKAGE.spec --nodeps --define=\"_topdir $SPECVAR_WORKINGHOME/RPM\""; RET=$? ;; "rpmbuild") [ "$RPMFORCE" = "true" ] && RPMFORCEADD="--force-build" [ "$RPMBUILDARCH" -a "$RPMBUILDARCH" != "${AUTOPORT_ARCH[$ENVIRONMENT]}" ] && \ RPMARCHADD="-A $RPMBUILDARCH --define \"cross_target_cpu=$RPMBUILDARCH\"" @@ -1751,7 +1751,10 @@ case $REQUEST in } ;; "srpmbuild") [ "$RPMFORCE" = "true" ] && RPMFORCEADD="--nodeps" - $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "rpmbuild -bs --define=\"_sourcedir $SPECVAR_WORKINGHOME/RPM/SOURCES\" $RPMFORCEADD $PACKAGE.spec" + $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE \ + "rpmbuild -bs \ +--define=\"_topdir $SPECVAR_WORKINGHOME/RPM\" \ +$RPMFORCEADD $PACKAGE.spec" RET=$? ;; "autospeclistcheck") [ "$RPMBUILDARCH" -a "$RPMBUILDARCH" != "${AUTOPORT_ARCH[$ENVIRONMENT]}" ] && \ @@ -1771,7 +1774,9 @@ case $REQUEST in fi ;; "sendpackage") if [ "$SENDREPOSITORY" ]; then if [ "$SENDRECREATESRPM" = "true" ]; then - $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "rpmbuild -bs --define=\"_sourcedir $SPECVAR_WORKINGHOME/RPM/SOURCES\" $PACKAGE.spec $RPMFORCEADD && $AUTOSPEC_CMD -u $PACKAGE -a10 --server $SENDREPOSITORY" + $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "rpmbuild -bs \ +--define=\"_topdir $SPECVAR_WORKINGHOME/RPM\" \ +$PACKAGE.spec $RPMFORCEADD && $AUTOSPEC_CMD -u $PACKAGE -a10 --server $SENDREPOSITORY" RET=$? else $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "$AUTOSPEC_CMD -u $PACKAGE -a10 --server $SENDREPOSITORY" @@ -1788,7 +1793,9 @@ case $REQUEST in "sendsource") [ "$RPMFORCE" = "true" ] && RPMFORCEADD="--nodeps" if [ "$SENDREPOSITORY" ]; then if [ "$SENDRECREATESRPM" = "true" ]; then - $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "rpmbuild -bs --define=\"_sourcedir $SPECVAR_WORKINGHOME/RPM/SOURCES\" $PACKAGE.spec $RPMFORCEADD && $AUTOSPEC_CMD -u $PACKAGE -a10 --server $SENDREPOSITORY --norpm" + $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "rpmbuild -bs \ +--define=\"_topdir $SPECVAR_WORKINGHOME/RPM\" \ +$PACKAGE.spec $RPMFORCEADD && $AUTOSPEC_CMD -u $PACKAGE -a10 --server $SENDREPOSITORY --norpm" RET=$? if [ $RET -eq 0 ]; then social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"sent edited $PACKAGE source to $SENDREPOSITORY\" STIME=`date +%s`"