cron.buildd 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 oldstable-kfreebsd stable testing"
  10. if [ -e $ftpdir/Archive_Maintenance_In_Progress ]; then
  11. exit 0
  12. fi
  13. dists=
  14. now=$(date +%s)
  15. check=$(( now - 3*60 ))
  16. for dist in $DISTS; do
  17. smodtime=$(stat -c "%Y" $base/build-queues/dists/buildd-$dist/updates/*/source/Sources.gz | sort -n | tail -1)
  18. pmodtime=$(stat -c "%Y" $base/build-queues/dists/buildd-$dist/updates/*/binary-*/Packages.gz | sort -n | tail -1)
  19. if [ ${smodtime} -gt ${check} ] || [ ${pmodtime} -gt ${check} ]; then
  20. # Packages/Sources changed in the last minutes
  21. dists="${dists} ${dist}"
  22. else
  23. continue
  24. fi
  25. done
  26. if [ ! -z "${dists}" ]; then
  27. for d in ${dists}; do
  28. case ${d} in
  29. oldoldstable)
  30. send=wheezy
  31. ;;
  32. oldstable)
  33. send=jessie
  34. ;;
  35. oldstable-kfreebsd)
  36. send=jessie-kfreebsd
  37. ;;
  38. stable)
  39. send=stretch
  40. ;;
  41. testing)
  42. send=buster
  43. ;;
  44. *)
  45. send=unknown
  46. ;;
  47. esac
  48. ssh -n wbadm@buildd trigger.security $send
  49. done
  50. fi