webbuild-cgi: fix rpmbuild -bs and other rpmbuild calls by passing correct %_topdir according to environment

This commit is contained in:
Silvan Calarco 2014-06-10 00:19:26 +02:00
parent 6dd2bb37bc
commit 2dd4d2632d

View File

@ -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 <b>$PACKAGE</b> new package in <b>`print_environment_descr $ENVIRONMENT`</b> 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 <b>$PACKAGE</b> source to <b>$SENDREPOSITORY</b>\" STIME=`date +%s`"