diff --git a/webbuild/webbuild-cgi b/webbuild/webbuild-cgi index c0497fb..02079e5 100755 --- a/webbuild/webbuild-cgi +++ b/webbuild/webbuild-cgi @@ -1292,7 +1292,8 @@ if [ "$MAINTAINERMODE" != "true" ]; then done echo -n "" echo -n " " - echo -n " " + echo -n " " + echo -n " " # destination repository select echo -n "
Send to:" echo -n "$AUTODISTJOB\" STIME=`date +%s`" fi ;; "autodistbuild") [ "$AUTODISTFORCE" = "true" ] && AUTODISTADD="--force" || AUTODISTADD= + [ "$AUTODISTNOPREP" = "true" ] && AUTOSPEC="--noprep" || AUTOSPECADD= autodistjobs= if [ "$AUTODISTPKGS" ]; then for p in $AUTODISTPKGS; do @@ -1737,7 +1741,7 @@ case $REQUEST in else autodistjobs="$AUTODISTJOB" fi - $SUDO_WRAPPER background $ENVIRONMENT "$USER" "$PACKAGE" "autodist -v -b $autodistjobs --repository ${AUTOPORT_BASE_REPOSITORY[$ENVIRONMENT]} --arch $AUTODISTARCH --user $USER $AUTODISTADD -- --colors web" &>/dev/null + $SUDO_WRAPPER background $ENVIRONMENT "$USER" "$PACKAGE" "autodist -v -b $autodistjobs --repository ${AUTOPORT_BASE_REPOSITORY[$ENVIRONMENT]} --arch $AUTODISTARCH --user $USER $AUTODISTADD -- $AUTOSPECADD --colors web" &>/dev/null [ $? -ne 0 ] && RET=$? || { RET=-1 echo "Autodist build start. You may see the output in the Webbuild jobs box above." @@ -1803,10 +1807,12 @@ case $REQUEST in $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "rpmbuild -bp $PACKAGE.spec $RPMARCHADD --nodeps --define=\"_topdir $SPECVAR_WORKINGHOME/RPM\"" RET=$? ;; - "rpmbuild") [ "$RPMFORCE" = "true" ] && RPMFORCEADD="--force-build" + "rpmbuild") AUTOSPECADD="" + [ "$RPMFORCE" = "true" ] && AUTOSPECADD="--force-build" + [ "$NOPREP" = "true" ] && AUTOSPECADD="${AUTOSPECADD} --noprep" [ "$RPMBUILDARCH" -a "$RPMBUILDARCH" != "${AUTOPORT_ARCH[$ENVIRONMENT]}" ] && \ RPMARCHADD="-A $RPMBUILDARCH --define \"cross_target_cpu=$RPMBUILDARCH\"" - $SUDO_WRAPPER background $ENVIRONMENT "$USER" $PACKAGE "$AUTOSPEC_CMD -u $PACKAGE -a5,6 -b $RPMFORCEADD $RPMARCHADD" &>/dev/null + $SUDO_WRAPPER background $ENVIRONMENT "$USER" $PACKAGE "$AUTOSPEC_CMD -u $PACKAGE -a5,6 -b $AUTOSPECADD $RPMARCHADD" &>/dev/null # && echo \"Webbuild HINT: now you may want to click on 'build requirements', add build requirements in .spec file and then 'recreate SRPMS'\"" [ $? -ne 0 ] && RET=$? || { RET=-1 diff --git a/webbuild/webbuild-functions-private b/webbuild/webbuild-functions-private index a38d065..ebeeba8 100644 --- a/webbuild/webbuild-functions-private +++ b/webbuild/webbuild-functions-private @@ -1,6 +1,6 @@ # # webbuild functions-private include file -# Copyright (c) 2012-2014 by Silvan Calarco +# Copyright (c) 2012-2024 by Silvan Calarco # repository_list() { @@ -152,6 +152,7 @@ function print_showlogcontrols() { echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&" echo -n "REQUEST=consolecmd&CONSOLECMD=\"+getElementById('consolecmd').value+\"&" echo -n "RPMFORCE=\"+getElementById('rpmforce').checked+\"&" + echo -n "NOPREP=\"+getElementById('noprep').checked+\"&" echo -n "DEBUG=\"+getElementById('debug').checked+\"&" echo -n "SPECTEXT=\"+encodeURIComponent(editor.getValue()));>" # close tag @@ -192,7 +193,9 @@ function print_editorcontrols() { echo -n "" + echo -n "SPECTEXT=\"+encodeURIComponent(editor.getValue())+\"&" + echo -n "NOPREP=\"+getElementById('noprep').checked+\"&" + echo -n "RPMFORCE=\"+getElementById('rpmforce').checked); class=boldbutton>" # unpackaged files echo -n " ${WORKINGHOME}/RPM/SPECS/$PACKAGE.spec.tmp 2>/dev/null" + $SUCMDPREFIX "rpmspec -P ${WORKINGHOME}/RPM/SPECS/$PACKAGE.spec > ${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|"` - PACKAGE_VERSION=`rpmspec -q --srpm --queryformat \"%{VERSION}\" ${WORKINGHOME}/RPM/SPECS/$PACKAGE.spec` + # 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 + BUILDDIR_UNPARSED="$PACKAGE-%{version}" + fi + BUILDDIR=`rpmspec -q --srpm --queryformat \"${BUILDDIR_UNPARSED}\" ${WORKINGHOME}/RPM/SPECS/$PACKAGE.spec` while read line; do set -- $line [ "$1" = "%package" -o "$1" = "%description" ] && break @@ -105,7 +108,7 @@ if [ "$MODE" = "specinfo" ]; then [ "$specvar" = "$lastspecvar" ] && varidx=$(($varidx + 1)) || varidx=0 echo "$specvar[$varidx]=\"${line//\"/}\"" [ "$specvaridx" != "" ] && echo "${specvar}_idx[$varidx]=$specvaridx" - [ "$specvar" = "SPECVAR_Version" -a ! "$BUILDDIR" ] && BUILDDIR="$PACKAGE-${line}" + [ "$specvar" = "SPECVAR_Version" ] && PACKAGE_VERSION="${line}" fi lastspecvar=$specvar done < $SPECFILE.tmp