Tools for building 32-bit archlinux packages from archlinux.org's official, 64-bit tested PKGBUILDs et al.

ping-to-master 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/bin/sh
  2. # periodically connects to the buildmaster to call ping-from-slave to:
  3. # - report any update on the build process
  4. # - show that the build is still running
  5. # - get notified by the build master if the build is not necessary anymore
  6. # shellcheck disable=SC2119,SC2120
  7. # shellcheck source=../lib/load-configuration
  8. . "${0%/*}/../lib/load-configuration"
  9. # TODO: abort build if requested to
  10. parent_pid="$1"
  11. parent_tmp_dir="$2"
  12. exec 9> "${work_dir}/ping-build-master.lock"
  13. while kill -0 "${parent_pid}" && \
  14. [ -f "${parent_tmp_dir}/.ping-build-master" ]; do
  15. # shellcheck disable=SC2029
  16. find "${parent_tmp_dir}" \
  17. -xdev \
  18. -type f \
  19. -name '*.build-log' \
  20. -exec wc -l {} \; | \
  21. sed 's, .*/, ,' | \
  22. ssh \
  23. -i "${master_build_server_identity}" \
  24. -p "${master_build_server_port}" \
  25. "${master_build_server_user}@${master_build_server}" \
  26. 'ping-from-slave' "$(cat "${parent_tmp_dir}/.ping-build-master")" || \
  27. true
  28. # we wait upto 60 seconds to get the lock - if we get it, the parent
  29. # must have released it and we're finished
  30. if flock -w 60 9; then
  31. break
  32. fi
  33. done