webbuild-cgi: fixes to existing package check through distroquery

This commit is contained in:
Silvan Calarco 2014-11-13 14:30:28 +01:00
parent 9afdb96444
commit d435051d50

View File

@ -1034,13 +1034,13 @@ if [ "$REQUEST" = "prepare" -o "$REQUEST" = "updatespec" -o "$REQUEST" = "speccr
RET=$?
;;
"speccreate") if [ "$SPECCREATEURL" -a "$PACKAGE" ]; then
FOUND_EXISTING=`curl -s "${WEBBUILD_DISTROQUERY_URL}?query=$PACKAGE&search_milestone2=true&search_devel=true&search_sources=true&query_compact=true&replyplain=true" | \
FOUND_EXISTING=`curl -s "${WEBBUILD_DISTROQUERY_URL}?package=$PACKAGE&search_milestone2=true&search_devel=true&search_sources=true&query_compact=true&replyplain=true" | \
sed "s|.*\([0-9][0-9]*\) result.*|\1|"`
if [ "$FOUND_EXISTING" != "0" ]; then
if [ "$FOUND_EXISTING" != "0" -a "$FOUND_EXISTING" != "" ]; then
echo -n "<div align=left class=output id=outputtop style=\"font-family:serif;color:black;background-color:#E0F2D0;\">"
echo "<b><font color=red>ERROR: package already exists, please update from appropriate version:</font><b>"
echo -n "<hr><b>Search results for \"$PACKAGE\":</b>"
curl -s "${WEBBUILD_DISTROQUERY_URL}?query=$PACKAGE&search_milestone2=true&search_devel=true&search_sources=true&query_compact=true&replyplain=true" | \
curl -s "${WEBBUILD_DISTROQUERY_URL}?package=$PACKAGE&search_milestone2=true&search_devel=true&search_sources=true&query_compact=true&replyplain=true" | \
sed "s| \(href=.\)/| \1${SITE_BASE_URL}/|g"
echo -n "</div>"
RET=1
@ -1097,7 +1097,7 @@ if [ "$REQUEST" = "prepare" -o "$REQUEST" = "updatespec" -o "$REQUEST" = "speccr
autodistjobs="$AUTODISTJOB"
fi
[ "$REPOSITORY" ] && REPOSITORYADD="--repository $REPOSITORY" || REPOSITORYADD="--repository ${AUTOPORT_BASE_REPOSITORY[$ENVIRONMENT]}"
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "autodist -v -p $autodistjobs $REPOSITORYADD --arch $AUTODISTARCH --user $USER $AUTODISTADD"
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "autodist -v -p $autodistjobs $REPOSITORYADD --arch $AUTODISTARCH --user $USER $AUTODISTADD -- --colors web"
RET=$?
;;
"autodistupdate") [ "$AUTODISTFORCE" = "true" ] && AUTODISTADD="--force" || AUTODISTADD=