hourly.functions 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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 queues="new,byhand,stable-new"
  23. local bpqueues="backports-new,backports-policy"
  24. local gqueues="${queues},${bpqueues},deferred"
  25. do_report
  26. do_report ${webdir}/backports-new.html "-n -d ${bpqueues}"
  27. dak queue-report -8 -d ${queues},${bpqueues} -r ${webdir}/stat
  28. log "Graphs about the queues"
  29. dak graph -n ${gqueues} -r ${webdir}/stat -i ${webdir}/stat -x ${scriptsdir}/rrd-release-freeze-dates
  30. }
  31. function removalstxt() {
  32. cd ${webdir}
  33. cat removals-20*.txt > removals-full.txt
  34. cat removals.txt >> removals-full.txt
  35. cat removals-20*.822 > removals-full.822
  36. cat removals.822 >> removals-full.822
  37. }
  38. function rss() {
  39. log "NEW RSS feed"
  40. PYTHONHASHSEED=0 ${base}/dak/tools/queue_rss.py -q ${queuedir}/new -o ${webdir}/rss/ -d ${base}/misc -l ${base}/log/
  41. log "Removals RSS feed"
  42. ${base}/dak/tools/removals.pl ${configdir}/removalsrss.rc > ${webdir}/rss/removals.rss
  43. }
  44. function gen_di() {
  45. ${scriptsdir}/generate-d-i
  46. }
  47. function backportsacl() {
  48. # Update backports ACL
  49. sudo -u dak-unpriv cat /srv/backports-master.debian.org/etc/acl \
  50. | dak acl set-fingerprints backports \
  51. | mail -a "X-Debian: DAK" -e -s "backports: acl changes" -a "From: Debian FTP Masters <ftpmaster@ftp-master.debian.org>" backports-team@debian.org
  52. }
  53. # do the buildd key updates
  54. function builddautosigning() {
  55. BUILDDFUN=$( gettempfile )
  56. local what=${1:-"none"}
  57. exec >> "${BUILDDFUN}" 2>&1
  58. if [[ ${what} == none ]]; then
  59. ${scriptsdir}/buildd-remove-keys
  60. ${scriptsdir}/buildd-add-keys
  61. ${scriptsdir}/buildd-prepare-dir
  62. fi
  63. for keyring in $(dak admin k list-binary); do
  64. dak import-keyring --generate-users "%s" ${keyring}
  65. done
  66. exec >>/dev/null 2>&1
  67. DATE=$(date -Is)
  68. 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}"
  69. rm -f "${BUILDDFUN}"
  70. }
  71. function updateweb() {
  72. cd ${webdir}
  73. git clean -fd
  74. git reset --hard
  75. git pull
  76. }