validate-default-seccomp 690 B

123456789101112131415161718192021222324252627
  1. #!/bin/bash
  2. source "${MAKEDIR}/.validate"
  3. IFS=$'\n'
  4. files=( $(validate_diff --diff-filter=ACMR --name-only -- 'profiles/seccomp' || true) )
  5. unset IFS
  6. if [ ${#files[@]} -gt 0 ]; then
  7. # We run vendor.sh to and see if we have a diff afterwards
  8. go generate ./profiles/seccomp/ >/dev/null
  9. # Let see if the working directory is clean
  10. diffs="$(git status --porcelain -- profiles/seccomp 2>/dev/null)"
  11. if [ "$diffs" ]; then
  12. {
  13. echo 'The result of go generate ./profiles/seccomp/ differs'
  14. echo
  15. echo "$diffs"
  16. echo
  17. echo 'Please re-run go generate ./profiles/seccomp/'
  18. echo
  19. } >&2
  20. false
  21. else
  22. echo 'Congratulations! Seccomp profile generation is done correctly.'
  23. fi
  24. fi