diff --git a/webbuild/html/scripts/webbuild.js b/webbuild/html/scripts/webbuild.js index 372714d..4fe09f3 100644 --- a/webbuild/html/scripts/webbuild.js +++ b/webbuild/html/scripts/webbuild.js @@ -90,6 +90,11 @@ function suggestSpecName(url) { if (document.getElementById("speccreatetype").options[j].value == "python") document.getElementById("speccreatetype").options[j].selected=true; }; + } else if (url.search("kde.org") >= 0) { + for (var j=0;j" +if [ "$REQUEST" != "rpmmanagerdownload" ]; then + echo -e "Content-type: text/xml\nPragma: no-cache\n" + echo -n "" +fi # SECURITY USER_ENABLED= @@ -40,6 +42,10 @@ if [ "$USER" ]; then . $WEBBUILD_STATEDIR/users/$USER.conf fi if [ "$USER_ENABLED" ]; then + if [ "$USER_EMAIL" ]; then + grep "USER_EMAIL=" $WEBBUILD_STATEDIR/users/$USER.conf >/dev/null || + echo "USER_EMAIL=$USER_EMAIL" >> $WEBBUILD_STATEDIR/users/$USER.conf + fi USER_ENABLED= if [ "$SECRET" = "$USER_SECRET" ]; then [ "$REMOTE_ADDR" = "127.0.0.1" -o "$USER_SECRET" ] && USER_ENABLED=1 || USER_ENABLED= @@ -225,7 +231,7 @@ if [ "$REQUEST" = "refresh" -o ! "$USER" ]; then STARGET= SID= eval $line - [ "$SID" -a "$FROMID" ] || continue + [ "$SID" ] || continue [ $SID -ge $FROMID ] || continue [ "$STARGET" = "developers" -a ! "$USER" ] && continue [ "$SUSER" = "$USER" -a "$STARGET" == "developers" ] && continue @@ -277,6 +283,21 @@ _EOF . $WEBBUILD_STATEDIR/cache/config-dynamic fi + +if [ "$REQUEST" = "rpmmanagerdownload" ]; then + resolve_rpmmanagerdir "$RPMMANAGERDIR" "${AUTOPORT_ARCH[$ENVIRONMENT]}" "$REPOSITORY" + for f in $RPMMANAGERPACKAGES; do + installpackages="$installpackages $rpmmanagerdir/$f" + done + if [ "$rpmmanagermode" = "environment" ]; then + download_file $ENVIRONMENT "$installpackages" + else + download_file "" "$installpackages" + fi + RET=$? + exit +fi + # delete a note if [ "$REQUEST" = "removenote" ]; then if [ "$USER" = "$NOTEUSER" -o "$USER_ADMIN" ]; then @@ -295,10 +316,12 @@ if [ "$USER_ADMIN" -a "$REQUEST" = "enableuser" ]; then cat >> $WEBBUILD_STATEDIR/users/$REQUEST_USER.conf << _EOF USER_ENABLED=1 USER_SECRET='$REQUEST_SECRET' +USER_EMAIL='$REQUEST_USER_EMAIL' _EOF else cat >> $WEBBUILD_STATEDIR/users/$REQUEST_USER.conf << _EOF USER_ENABLED=0 +USER_EMAIL='$REQUEST_USER_EMAIL' _EOF fi fi @@ -343,10 +366,10 @@ if [ "$REQUEST" = "refresh" -o "$REQUEST" = "refreshjobs" ]; then esac echo -n " " + echo -n "REQUEST=enableuser&REQUEST_ACCEPT=true&REQUEST_USER=$REQUEST_USER&REQUEST_USER_EMAIL=$REQUEST_USER_EMAIL&REQUEST_SECRET=`cgi_encodevar $REQUEST_SECRET`\");>" echo -n " " + echo -n "REQUEST=enableuser&REQUEST_ACCEPT=&REQUEST_USER=$REQUEST_USER&REQUEST_USER_EMAIL=$REQUEST_USER_EMAIL&REQUEST_SECRET=`cgi_encodevar $REQUEST_SECRET`\");>" done < $WEBBUILD_STATEDIR/requests echo -n "" fi @@ -466,20 +489,68 @@ if [ "$REQUEST" = "environmentsearch" ]; then exit fi -# install rpms window +# rpm manager if [ "$REQUEST" = "rpmmanager" ]; then environment_descr=`print_environment_descr $i` echo -n "
" - echo -n "
" + echo -n "
" echo -n "RPM manager for $environment_descr environment
" - echo -n "
" + + # select rpm manager resource directory to display + echo "" + + # multiselect + echo -n "
" + echo -n "
" echo -n "
" - $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "ls -t ../RPMS/${AUTOPORT_ARCH[$ENVIRONMENT]}/*.${AUTOPORT_ARCH[$ENVIRONMENT]}.rpm ../RPMS/noarch/*.noarch.rpm 2>/dev/null" | \ - while read f; do + + resolve_rpmmanagerdir "$RPMMANAGERDIR" "${AUTOPORT_ARCH[$ENVIRONMENT]}" "$REPOSITORY" + rpmmanagerfiles=$rpmmanagerdir/$rpmmanagermask + if [ "${rpmmanagermode}" = "environment" ]; then + # local files in environment + $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "ls -t $rpmmanagerfiles 2>/dev/null" | \ + while read f; do pkgname=`basename $f` - echo -n "" - done + echo -n "" + done + else + # files in real local repositories + ls -t $rpmmanagerfiles 2>/dev/null | \ + while read f; do + pkgname=`basename $f` + echo -n "" + done + fi echo -n "
" echo -n "
" @@ -491,6 +562,7 @@ if [ "$REQUEST" = "rpmmanager" ]; then echo -n "p=getCheckedValuesByName('rpmmanagercheckbox');" echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&" echo -n "RPMMANAGERPACKAGES=\"+encodeURIComponent(p)+\"&" + echo -n "RPMMANAGERPACKAGES=\"+encodeURIComponent(p)+\"&" echo -n "RPMMANAGERFORCE=\"+getElementById('rpmmanagerforce').checked+\"&" echo -n "REQUEST=rpmmanagerinstall\"" echo -n ",\"`cgi_encodevar "Install "`\"+p+" @@ -505,9 +577,10 @@ if [ "$REQUEST" = "rpmmanager" ]; then echo -n "REQUEST=rpmmanagerupgrade\"" echo -n ",\"`cgi_encodevar "Upgrade "`\"+p+" echo -n "\"`cgi_encodevar " in $environment_descr environment?"`\"" - echo -n ");>" + echo -n ");>  " fi + # rpm manager close link echo -n "
CLOSE
" echo "]]>" exit @@ -719,7 +792,7 @@ else [ "$STATE_AUTODISTCURRENT" = "1" ] && AUTOUPDATEFILE=$BUILDLOGDIR/autoupdate-current || AUTOUPDATEFILE=$BUILDLOGDIR/autoupdate-last while read line; do set -- $line - if [ "$3" != "ok" ]; then + if [ "$3" != "ok" -a "$3" != "skipped" ]; then if [ "$REQUEST" != "skip" ]; then [ "$PACKAGE" = "$1" ] && SELECTED="selected=selected" || SELECTED= else @@ -787,17 +860,22 @@ if [ "$MAINTAINERMODE" = "true" -o ! "${AUTOPORT_UPDATE[$ENVIRONMENT]}" ]; then #(getElementById('package').selectedIndex);>" echo "" SRPMBUTTONDISABLED="disabled=disabled" - if [ $local_ftp/$REPOSITORY/SRPMS.base -nt $WEBBUILD_STATEDIR/cache/repository-src-$REPOSITORY ]; then - ls $local_ftp/$REPOSITORY/SRPMS.base/*.src.rpm | sort -f > $WEBBUILD_STATEDIR/cache/repository-src-$REPOSITORY + if [ -e $local_ftp/$REPOSITORY ]; then + if [ $local_ftp/$REPOSITORY/SRPMS.base -nt $WEBBUILD_STATEDIR/cache/repository-src-$REPOSITORY ]; then + ls $local_ftp/$REPOSITORY/SRPMS.base/*.src.rpm | sort -f > $WEBBUILD_STATEDIR/cache/repository-src-$REPOSITORY + fi + else + curl $REPS_BASE_URL/$REPOSITORY/SRPMS.base/ | grep .src.rpm | \ + sed "s|.*\.src\.rpm\">\(.*\).*|\1|" | sort -f > $WEBBUILD_STATEDIR/cache/repository-src-$REPOSITORY fi while read f; do - [ -r $f ] || continue +# [ -r $f ] || continue pkgname=`basename $f` - pkgname=${pkgname/.src.rpm} + pkgname=${pkgname%.src.rpm} pkgrel=${pkgname/*-} - pkgname=${pkgname/-$pkgrel} + pkgname=${pkgname%-$pkgrel} pkgver=${pkgname/*-} - pkgname=${pkgname/-$pkgver} + pkgname=${pkgname%-$pkgver} if [ "$PACKAGE" = "$pkgname" ]; then SELECTED="selected=\"selected\"" SRPMBUTTONDISABLED= @@ -843,7 +921,7 @@ if [ "$MAINTAINERMODE" = "true" -o ! "${AUTOPORT_UPDATE[$ENVIRONMENT]}" ]; then done echo -n "" echo -n " version:" - echo -n " branch:" + echo -n " branch/tag:" echo -n "$PACKAGE new package in `print_environment_descr $ENVIRONMENT` environment\" STIME=`date +%s`" - echo "
HINT: don't forget to add build requirements after successful build! Edit specfile and check recreate SRPM before sending the package." + # prepare + $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "rpmbuild -bp $PACKAGE.spec --nodeps" + RET=$? + if [ $RET -eq 0 ]; then + REQUEST_NEXT="showbuilddocs" + fi + #echo "
HINT: don't forget to add build requirements after successful build! Edit specfile and check recreate SRPM before sending the package." } else echo "ERROR: both source archive URL and name are needed." @@ -949,7 +1033,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 $AUTODISTADD" + $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "autodist -v -p $autodistjobs $REPOSITORYADD --arch $AUTODISTARCH --user $USER $AUTODISTADD" RET=$? ;; "autodistupdate") [ "$AUTODISTFORCE" = "true" ] && AUTODISTADD="--force" || AUTODISTADD= @@ -966,7 +1050,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 -u $autodistjobs $REPOSITORYADD --arch $AUTODISTARCH $AUTODISTADD" + $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "autodist -v -u $autodistjobs $REPOSITORYADD --arch $AUTODISTARCH --user $USER $AUTODISTADD" RET=$? ;; "addpkgnote") echo "`date +%s` $USER $ENVIRONMENT $PKGNOTE" >> $WEBBUILD_STATEDIR/notes/$PACKAGE.notes; RET=$? ;; @@ -1072,7 +1156,7 @@ if [ "$REQUEST" = "edit" -o "$REQUEST" = "reloadspec" -o "$REQUEST" = "switchmai fi fi fi - REQUEST= + REQUEST=$REQUEST_NEXT fi # operation panel @@ -1289,7 +1373,8 @@ if [ "$MAINTAINERMODE" != "true" ]; then echo -n "$PACKAGE package in "`\"+p+\"`cgi_encodevar " with current specfile changes?"`\"); class=redbutton>" @@ -1304,7 +1389,7 @@ if [ "$MAINTAINERMODE" != "true" ]; then echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=autospecupdatescheck&" echo -n "SPECTEXT=\"+encodeURIComponent(editor.getValue()));>" # unpack - echo -n "" # build @@ -1412,7 +1497,7 @@ if [ "$MAINTAINERMODE" != "true" ]; then patchname=${f/*\/} patchname=${patchname/.patch} patchname=${patchname/$PACKAGE-} - echo -n "" + echo -n "" done echo -n "" # list build dir files @@ -1473,7 +1558,7 @@ fi echo -n "Write a message to all developers:
" -echo -n "