| 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 | |
| 7 | if [ "$ALEMBIC" = ":" ]; then |
| 8 | echo "Install alembic and re-run configure before using this target." |
| 9 | exit 1 |
| 10 | fi |
| 11 | |
| 12 | cd contrib/ast-db-manage |
| 13 | |
| 14 | FOUNDERROR= |
| 15 | for id in "$@"; do |
| 16 | if [ -n "$($ALEMBIC -c ${id}.ini.sample branches)" ]; then |
| 17 | echo "Alembic branches exist for $id - details follow:" |
| 18 | # This second run is needed to display the errors because |
| 19 | # formatting was lost in the first execution. |
| 20 | $ALEMBIC -c ${id}.ini.sample branches |
| 21 | # Display all errors before reporting failure to Make. |
| 22 | FOUNDERROR=yes |
| 23 | fi |
| 24 | done |
| 25 | |
| 26 | if [ -n "$FOUNDERROR" ]; then |
| 27 | # One or more failures. |
| 28 | exit 1 |
| 29 | fi |