make_check_alembic 721 B

1234567891011121314151617181920212223242526272829
  1. #!/bin/sh
  2. if [ -z "$ALEMBIC" -o ! -d contrib/ast-db-manage ]; then
  3. echo "Run 'make check-alembic' to use this script" >&2
  4. exit 1
  5. fi
  6. if [ "$ALEMBIC" = ":" ]; then
  7. echo "Install alembic and re-run configure before using this target."
  8. exit 1
  9. fi
  10. cd contrib/ast-db-manage
  11. FOUNDERROR=
  12. for id in "$@"; do
  13. if [ -n "$($ALEMBIC -c ${id}.ini.sample branches)" ]; then
  14. echo "Alembic branches exist for $id - details follow:"
  15. # This second run is needed to display the errors because
  16. # formatting was lost in the first execution.
  17. $ALEMBIC -c ${id}.ini.sample branches
  18. # Display all errors before reporting failure to Make.
  19. FOUNDERROR=yes
  20. fi
  21. done
  22. if [ -n "$FOUNDERROR" ]; then
  23. # One or more failures.
  24. exit 1
  25. fi