[asterisk-commits] Build System: Add support for checking alembic branches. (asterisk[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jan 21 20:57:02 CST 2016


Matt Jordan has submitted this change and it was merged.

Change subject: Build System: Add support for checking alembic branches.
......................................................................


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
---
M Makefile
A build_tools/make_check_alembic
M configure
M configure.ac
M makeopts.in
5 files changed, 83 insertions(+), 5 deletions(-)

Approvals:
  Anonymous Coward #1000019: Verified
  Matt Jordan: Looks good to me, approved
  Joshua Colp: Looks good to me, but someone else must approve



diff --git a/Makefile b/Makefile
index 4b1c57b..b1de3d2 100644
--- a/Makefile
+++ b/Makefile
@@ -1009,6 +1009,10 @@
 		rest-api/resources.json .
 endif
 
+check-alembic: makeopts
+	@find contrib/ast-db-manage/ -name '*.pyc' -delete
+	@ALEMBIC=$(ALEMBIC) build_tools/make_check_alembic config cdr voicemail >&2
+
 .PHONY: menuselect
 .PHONY: main
 .PHONY: sounds
@@ -1030,6 +1034,7 @@
 .PHONY: _clean
 .PHONY: ari-stubs
 .PHONY: basic-pbx
+.PHONY: check-alembic
 .PHONY: $(SUBDIRS_INSTALL)
 .PHONY: $(SUBDIRS_DIST_CLEAN)
 .PHONY: $(SUBDIRS_CLEAN)
diff --git a/build_tools/make_check_alembic b/build_tools/make_check_alembic
new file mode 100755
index 0000000..ecc5fc1
--- /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
diff --git a/configure b/configure
index bc51839..fc76131 100755
--- a/configure
+++ b/configure
@@ -1174,6 +1174,7 @@
 LDCONFIG
 DOWNLOAD
 FETCH
+ALEMBIC
 GIT
 XMLSTARLET
 XMLLINT
@@ -7479,6 +7480,47 @@
 fi
 
 
+# Extract the first word of "alembic", so it can be a program name with args.
+set dummy alembic; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ALEMBIC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ALEMBIC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ALEMBIC="$ALEMBIC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_ALEMBIC="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_ALEMBIC" && ac_cv_path_ALEMBIC=":"
+  ;;
+esac
+fi
+ALEMBIC=$ac_cv_path_ALEMBIC
+if test -n "$ALEMBIC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ALEMBIC" >&5
+$as_echo "$ALEMBIC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
 if test "${WGET}" != ":" ; then
   DOWNLOAD=${WGET}
 else if test "${CURL}" != ":" ; then
@@ -13653,7 +13695,7 @@
     We can't simply define LARGE_OFF_T to be 9223372036854775807,
     since some C++ compilers masquerading as C compilers
     incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
 		       && LARGE_OFF_T % 2147483647 == 1)
 		      ? 1 : -1];
@@ -13699,7 +13741,7 @@
     We can't simply define LARGE_OFF_T to be 9223372036854775807,
     since some C++ compilers masquerading as C compilers
     incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
 		       && LARGE_OFF_T % 2147483647 == 1)
 		      ? 1 : -1];
@@ -13723,7 +13765,7 @@
     We can't simply define LARGE_OFF_T to be 9223372036854775807,
     since some C++ compilers masquerading as C compilers
     incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
 		       && LARGE_OFF_T % 2147483647 == 1)
 		      ? 1 : -1];
@@ -13768,7 +13810,7 @@
     We can't simply define LARGE_OFF_T to be 9223372036854775807,
     since some C++ compilers masquerading as C compilers
     incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
 		       && LARGE_OFF_T % 2147483647 == 1)
 		      ? 1 : -1];
@@ -13792,7 +13834,7 @@
     We can't simply define LARGE_OFF_T to be 9223372036854775807,
     since some C++ compilers masquerading as C compilers
     incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
 		       && LARGE_OFF_T % 2147483647 == 1)
 		      ? 1 : -1];
diff --git a/configure.ac b/configure.ac
index 021d0d1..e7b7e57 100644
--- a/configure.ac
+++ b/configure.ac
@@ -279,6 +279,7 @@
 AC_PATH_PROG([XMLLINT], [xmllint], :)
 AC_PATH_PROG([XMLSTARLET], [xmlstarlet], :)
 AC_PATH_PROG([GIT], [git], :)
+AC_PATH_PROG([ALEMBIC], [alembic], :)
 if test "${WGET}" != ":" ; then
   DOWNLOAD=${WGET}
 else if test "${CURL}" != ":" ; then
diff --git a/makeopts.in b/makeopts.in
index d91dc9b..f606ace 100644
--- a/makeopts.in
+++ b/makeopts.in
@@ -38,6 +38,7 @@
 OPENSSL=@OPENSSL@
 LDCONFIG=@LDCONFIG@
 GIT=@GIT@
+ALEMBIC=@ALEMBIC@
 
 BUILD_PLATFORM=@BUILD_PLATFORM@
 BUILD_CPU=@BUILD_CPU@

-- 
To view, visit https://gerrit.asterisk.org/2065
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibb3cae7d1202ac23dc70b0f3b5801571ad46b004
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>



More information about the asterisk-commits mailing list