cron.buildd 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #! /bin/bash
  2. #
  3. # Executed after cron.unchecked
  4. set -e
  5. set -o pipefail
  6. set -u
  7. export SCRIPTVARS=/srv/security-master.debian.org/dak/config/debian-security/vars
  8. . $SCRIPTVARS
  9. DISTS="oldoldstable oldstable-security stable-security testing-security"
  10. if [ -e $ftpdir/Archive_Maintenance_In_Progress ]; then
  11. exit 0
  12. fi
  13. last_changed=${1:?}
  14. trigger_wb() {
  15. local dist="${1:?}"
  16. local send=
  17. case "${dist}" in
  18. oldoldstable|oldstable-security|stable-security|testing-security)
  19. send=$(dak admin suite-config get-value "${dist}" codename)
  20. send=${send%-security}
  21. ;;
  22. *)
  23. send=unknown
  24. ;;
  25. esac
  26. echo "triggering w-b for suite ${dist} (known as ${send} by w-b)"
  27. ssh -n wbadm@buildd trigger.security $send
  28. }
  29. for dist in $DISTS; do
  30. dist_changed=$(psql -qAtc "SELECT BOOL_OR(last_changed > '${last_changed}') FROM suite WHERE suite_name IN ('${dist}', 'buildd-${dist}')")
  31. if [[ "${dist_changed}" = "t" ]]; then
  32. trigger_wb ${dist}
  33. fi
  34. done