hourly.functions 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. # -*- mode:sh -*-
  2. function importusers() {
  3. dak import-users-from-passwd
  4. }
  5. function newoverview() {
  6. do_new
  7. log "Output html for packages in NEW"
  8. dak show-new > /dev/null || true
  9. }
  10. function do_report() {
  11. local target=${1:-"${webdir}/new.html"}
  12. local opts=${2:-"-n"}
  13. local TMPOUT=$( mktemp -p "${TMPDIR}" reportout.XXXXXX )
  14. TMPFILES="${TMPFILES} ${TMPOUT}"
  15. dak queue-report ${opts} > ${TMPOUT}
  16. chmod 644 ${TMPOUT}
  17. mv -f ${TMPOUT} ${target}
  18. }
  19. function queuereport() {
  20. log "Creating queue reports, new/backports-new, 822 format"
  21. local queues="new,byhand,stable-new,oldstable-new"
  22. local bpqueues="backports-new,backports-policy"
  23. local gqueues="${queues},${bpqueues},deferred"
  24. do_report
  25. do_report ${webdir}/backports-new.html "-n -d ${bpqueues}"
  26. dak queue-report -8 -d ${queues},${bpqueues} -r ${webdir}/stat
  27. log "Graphs about the queues"
  28. dak graph -n ${gqueues} -r ${webdir}/stat -i ${webdir}/stat -x ${scriptsdir}/rrd-release-freeze-dates
  29. }
  30. function removalstxt() {
  31. cd ${webdir}
  32. cat removals-20*.txt > removals-full.txt
  33. cat removals.txt >> removals-full.txt
  34. cat removals-20*.822 > removals-full.822
  35. cat removals.822 >> removals-full.822
  36. }
  37. function rss() {
  38. log "NEW RSS feed"
  39. ${base}/dak/tools/queue_rss.py -q ${queuedir}/new -o ${webdir}/rss/ -d ${base}/misc -l ${base}/log/
  40. log "Removals RSS feed"
  41. ${base}/dak/tools/removals.pl ${configdir}/removalsrss.rc > ${webdir}/rss/removals.rss
  42. }
  43. function gen_di() {
  44. ${scriptsdir}/generate-d-i
  45. }
  46. function backportsacl() {
  47. # Update backports ACL
  48. sudo -u dak-unpriv cat /srv/backports-master.debian.org/etc/acl \
  49. | dak acl set-fingerprints backports \
  50. | mail -a "X-Debian: DAK" -e -s "backports: acl changes" -a "From: Debian FTP Masters <ftpmaster@ftp-master.debian.org>" backports-team@debian.org
  51. }
  52. # do the buildd key updates
  53. function builddautosigning() {
  54. BUILDDFUN=$( gettempfile )
  55. local what=${1:-"none"}
  56. exec >> "${BUILDDFUN}" 2>&1
  57. if [[ ${what} == none ]]; then
  58. ${scriptsdir}/buildd-remove-keys
  59. ${scriptsdir}/buildd-add-keys
  60. ${scriptsdir}/buildd-prepare-dir
  61. fi
  62. for keyring in $(dak admin k list-binary); do
  63. dak import-keyring --generate-users "%s" ${keyring}
  64. done
  65. exec >>/dev/null 2>&1
  66. DATE=$(date -Is)
  67. mail -a "X-Debian: DAK" -e -s "[${HOSTNAME}] Buildd key changes ${DATE}" -a "From: Debian FTP Masters <ftpmaster@ftp-master.debian.org>" buildd-keys@ftp-master.debian.org < "${BUILDDFUN}"
  68. rm -f "${BUILDDFUN}"
  69. }
  70. function updateweb() {
  71. cd ${webdir}
  72. git clean -fd
  73. git reset --hard
  74. git pull
  75. }