webbuild: fix autodist prepare and update; run ldconfig in build requirements; support version in autodist update

This commit is contained in:
Silvan Calarco 2014-10-29 22:36:58 +01:00
parent 66ce879682
commit 6032d80cdb

View File

@ -1088,15 +1088,18 @@ if [ "$REQUEST" = "prepare" -o "$REQUEST" = "updatespec" -o "$REQUEST" = "speccr
AUTODISTADD="$AUTODISTADD --rebuild -- --changelog \"${AUTODISTUPDATECHANGELOG}\""
fi
autodistjobs=
if [ "$AUTODISTVERSION" ]; then
AUTODISTVER="\#$AUTODISTVERSION"
fi
if [ "$AUTODISTPKGS" ]; then
for p in $AUTODISTPKGS; do
autodistjobs="$autodistjobs $AUTODISTJOB/$p"
autodistjobs="$autodistjobs $AUTODISTJOB/$p${AUTODISTVER}"
done
else
autodistjobs="$AUTODISTJOB"
autodistjobs="$AUTODISTJOB${AUTODISTVER}"
fi
[ "$REPOSITORY" ] && REPOSITORYADD="--repository $REPOSITORY" || REPOSITORYADD="--repository ${AUTOPORT_BASE_REPOSITORY[$ENVIRONMENT]}"
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "autodist -v -u $autodistjobs $REPOSITORYADD --arch $AUTODISTARCH --user $USER $AUTODISTADD"
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "autodist -v -u $autodistjobs $REPOSITORYADD --arch $AUTODISTARCH --user $USER $AUTODISTADD -- --colors web"
RET=$?
;;
"addpkgnote") echo "`date +%s` $USER $ENVIRONMENT $PKGNOTE" >> $WEBBUILD_STATEDIR/notes/$PACKAGE.notes; RET=$? ;;
@ -1359,6 +1362,7 @@ if [ "$MAINTAINERMODE" != "true" ]; then
echo -n "AUTODISTJOB=\"+getSelectedValueById('autodistjobs')+\"&"
echo -n "AUTODISTPKGS=\"+encodeURIComponent(p)+\"&"
echo -n "AUTODISTUPDATECHANGELOG=\"+encodeURIComponent(getElementById('autodistupdatechangelog').value)+\"&"
echo -n "AUTODISTVERSION=\"+getElementById('autodistversion').value+\"&"
echo -n "ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=autodistupdate\");>"
# autodist build
echo -n "<input type=button value=\"build\" onclick="
@ -1393,16 +1397,16 @@ if [ "$MAINTAINERMODE" != "true" ]; then
echo -n "ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=autodistsend\""
echo -n ",\"`cgi_encodevar "Send selected packages for <b>"`\"+getSelectedValueById('autodistjobs')+\"`cgi_encodevar "</b> job to <b>"`\"+"
echo -n "getSelectedValueById('sendrepository')+\"`cgi_encodevar "</b>?"`\"); class=redbutton $DISABLED>"
# autodist update changelog
echo -n "Rebuild changelog:<br>"
echo -n "<input type=text id=autodistupdatechangelog style=\"width:95%\">"
# autodist schedule
echo -n "<br><input type=button value=\"schedule job\" onclick="
echo -n "<br>New version:<input type=text id=autodistversion value=\"\" style=\"width:20%\"> "
echo -n "<input type=button value=\"schedule job\" onclick="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&"
echo -n "AUTODISTJOB=\"+getSelectedValueById('autodistjobs')+\"&"
echo -n "REQUEST=schedule&SCHEDULEVERSION=\"+getElementById('scheduleversion').value"
echo -n "REQUEST=schedule&AUTODISTVERSION=\"+getElementById('autodistversion').value"
echo -n ",\"`cgi_encodevar "Schedule <b>"`\"+getSelectedValueById('autodistjobs')+\"`cgi_encodevar "</b> autodist job for automatic update?"`\"); class=boldbutton>"
echo -n "(version:<input type=text id=scheduleversion value=\"\" size=\"6\">)"
# autodist update changelog
echo -n "<br>Rebuild changelog:<br>"
echo -n "<input type=text id=autodistupdatechangelog style=\"width:95%\">"
# autodist show schedule
echo -n "<input type=button value=\"show schedule\" onclick=ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&"
echo -n "REQUEST=showscheduled\");>"
@ -1649,7 +1653,7 @@ case $REQUEST in
"smartupgrade") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "export LANG=C;sudo smart update && sudo smart upgrade"
RET=$?
;;
"runldconfig") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "/sbin/ldconfig"
"runldconfig") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "export LANG=C;sudo /sbin/ldconfig"
RET=$?
;;
"showpatch") $SUDO_WRAPPER binary $ENVIRONMENT "$USER" $PACKAGE "autodist-tool makepatch $PACKAGE"; RET=$? ;;
@ -1674,11 +1678,11 @@ case $REQUEST in
social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"made an autodist <b>build</b> patch for <b>$PACKAGE</b>\" STIME=`date +%s`"
fi ;;
"showscheduled") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "autodist-tool schedule"; RET=$? ;;
"schedule") if [ "$SCHEDULEVERSION" ]; then
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "autodist-tool schedule $AUTODISTJOB#$SCHEDULEVERSION"
"schedule") if [ "$AUTODISTVERSION" ]; then
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "autodist-tool schedule $AUTODISTJOB#$AUTODISTVERSION"
RET=$?
if [ $RET -eq 0 ]; then
social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"scheduled autodist job <b>$AUTODISTJOB</b> for update to version $SCHEDULEVERSION\" STIME=`date +%s`"
social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"scheduled autodist job <b>$AUTODISTJOB</b> for update to version $AUTODISTVERSION\" STIME=`date +%s`"
fi
else
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "autodist-tool schedule $AUTODISTJOB"
@ -1702,7 +1706,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" &>/dev/null
$SUDO_WRAPPER background $ENVIRONMENT "$USER" "$PACKAGE" "autodist -v -b $autodistjobs --repository ${AUTOPORT_BASE_REPOSITORY[$ENVIRONMENT]} --arch $AUTODISTARCH --user $USER $AUTODISTADD -- --colors web" &>/dev/null
[ $? -ne 0 ] && RET=$? || {
RET=-1
echo "Autodist build start. You may see the output in the <b>Webbuild jobs</b> box above."
@ -1718,7 +1722,7 @@ case $REQUEST in
else
autodistjobs="$AUTODISTJOB"
fi
$SUDO_WRAPPER background $ENVIRONMENT "$USER" "$PACKAGE" "autodist -v -i $autodistjobs --repository ${AUTOPORT_BASE_REPOSITORY[$ENVIRONMENT]} --arch $AUTODISTARCH --user $USER $AUTODISTADD" &>/dev/null
$SUDO_WRAPPER background $ENVIRONMENT "$USER" "$PACKAGE" "autodist -v -i $autodistjobs --repository ${AUTOPORT_BASE_REPOSITORY[$ENVIRONMENT]} --arch $AUTODISTARCH --user $USER $AUTODISTADD -- --colors web" &>/dev/null
[ $? -ne 0 ] && RET=$? || {
RET=-1
echo "Autodist install start. You may see the output in the <b>Webbuild jobs</b> box above."
@ -1733,7 +1737,7 @@ case $REQUEST in
else
autodistjobs="$AUTODISTJOB"
fi
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "autodist -v -s $autodistjobs --repository ${AUTOPORT_BASE_REPOSITORY[$ENVIRONMENT]} --server $SENDREPOSITORY --arch $AUTODISTARCH --user $USER $AUTODISTADD"
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "autodist -v -s $autodistjobs --repository ${AUTOPORT_BASE_REPOSITORY[$ENVIRONMENT]} --server $SENDREPOSITORY --arch $AUTODISTARCH --user $USER $AUTODISTADD -- --colors web"
RET=$?
[ $RET -eq 0 ] && social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"sent <b>$AUTODISTPKGS $SPECVAR_Version-$SPECVAR_Release</b> from <i>`print_environment_descr $ENVIRONMENT`</i> to <b>$SENDREPOSITORY</b>\" STIME=`date +%s`"
;;
@ -1780,7 +1784,9 @@ $RPMFORCEADD $PACKAGE.spec"
RPMARCHADD="-A $RPMBUILDARCH --define \"cross_target_cpu=$RPMBUILDARCH\""
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "$AUTOSPEC_CMD -u $PACKAGE -a5 --list-check --force $RPMARCHADD"
RET=$? ;;
"autospecbuildreq") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "$AUTOSPEC_CMD -u $PACKAGE -a6"
"autospecbuildreq")
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "sudo /sbin/ldconfig"
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "$AUTOSPEC_CMD -u $PACKAGE -a6"
RET=$? ;;
"rpmchecks") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "$AUTOSPEC_CMD -u $PACKAGE -a8"; RET=$? ;;
"rpmsimulateinstall") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "$AUTOSPEC_CMD -u $PACKAGE -a7"; RET=$? ;;