summaryrefslogtreecommitdiff
path: root/build_tools
diff options
context:
space:
mode:
authorCorey Farrell <git@cfware.com>2016-01-21 17:40:47 -0500
committerCorey Farrell <git@cfware.com>2016-01-21 17:15:35 -0600
commit5dde111719aeb782f0ea1c6b253d143d75cf7091 (patch)
treef1d322d4e4d91726050b1a6c99726e443dd0ad08 /build_tools
parent53570e2c6fecc4debab93b7a8e70765306154001 (diff)
Build System: Add support for checking alembic branches.
* Add 'check-alembic' target to root Makefile. * Create build_tools/make_check_alembic to do the actual checks. ASTERISK-25685 Change-Id: Ibb3cae7d1202ac23dc70b0f3b5801571ad46b004
Diffstat (limited to 'build_tools')
-rwxr-xr-xbuild_tools/make_check_alembic29
1 files changed, 29 insertions, 0 deletions
diff --git a/build_tools/make_check_alembic b/build_tools/make_check_alembic
new file mode 100755
index 000000000..ecc5fc1c9
--- /dev/null
+++ b/build_tools/make_check_alembic
@@ -0,0 +1,29 @@
+#!/bin/sh
+if [ -z "$ALEMBIC" -o ! -d contrib/ast-db-manage ]; then
+ echo "Run 'make check-alembic' to use this script" >&2
+ exit 1
+fi
+
+if [ "$ALEMBIC" = ":" ]; then
+ echo "Install alembic and re-run configure before using this target."
+ exit 1
+fi
+
+cd contrib/ast-db-manage
+
+FOUNDERROR=
+for id in "$@"; do
+ if [ -n "$($ALEMBIC -c ${id}.ini.sample branches)" ]; then
+ echo "Alembic branches exist for $id - details follow:"
+ # This second run is needed to display the errors because
+ # formatting was lost in the first execution.
+ $ALEMBIC -c ${id}.ini.sample branches
+ # Display all errors before reporting failure to Make.
+ FOUNDERROR=yes
+ fi
+done
+
+if [ -n "$FOUNDERROR" ]; then
+ # One or more failures.
+ exit 1
+fi