[asterisk-scf-commits] asterisk-scf/integration/gitall.git branch "master" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Thu Apr 12 10:03:04 CDT 2012


branch "master" has been updated
       via  f3f93789f9582e95f399d95920d5e91da2df349d (commit)
      from  5fb8e912e145f93f038bee3de79115e3973e3ff6 (commit)

Summary of changes:
 setConfig.sh |   83 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 83 insertions(+), 0 deletions(-)
 create mode 100755 setConfig.sh


- Log -----------------------------------------------------------------
commit f3f93789f9582e95f399d95920d5e91da2df349d
Author: David M. Lee <dlee at digium.com>
Date:   Thu Apr 12 10:02:15 2012 -0500

    Added setConfig wrapper.
    
    This should allow us to more easily run configurator scripts.

diff --git a/setConfig.sh b/setConfig.sh
new file mode 100755
index 0000000..67d5671
--- /dev/null
+++ b/setConfig.sh
@@ -0,0 +1,83 @@
+#!/bin/sh
+
+#
+# Asterisk SCF -- An open-source communications framework.
+#
+# Copyright (C) 2012, Digium, Inc.
+#
+# See http://www.asterisk.org for more information about
+# the Asterisk SCF project. Please do not directly contact
+# any of the maintainers of this project for assistance;
+# the project provides a web site, mailing lists and IRC
+# channels for your use.
+#
+# This program is free software, distributed under the terms of
+# the GNU General Public License Version 2. See the LICENSE.txt file
+# at the top of the source tree.
+#
+
+#
+# Launcher for configurator scripts
+#
+
+TOPDIR=$(dirname "$0")
+TOPDIR=$(cd "${TOPDIR}" && pwd)
+PROGNAME=$(basename "$0" .sh)
+
+: ${PYTHON:=python}
+: ${ASTSCF_HOME=${TOPDIR}}
+
+export PYTHONPATH="${TOPDIR}/configurator:${ICE_HOME}/python:${PYTHONPATH}"
+export ASTSCF_HOME
+
+usage()
+{
+    cat <<EOF
+Usage: $0 [options...] [--] .py [configurator-args]
+
+Options:
+--debug  Start python debugger (python -m pdb)
+--help   This text
+--       Ends arguments for ${PROGNAME}
+
+Environment variables:
+  PYTHON      : (optional) Python executable.
+  PYTHON_ARGS : (optional) extra arguments to pass to python
+  ASTSCF_HOME : directory of gitall checkout (defaults to ${TOPDIR})
+EOF
+}
+
+while test $# -gt 0; do
+    case $1 in
+        --debug)
+            PYTHON_ARGS="-m pdb ${PYTHON_ARGS}"
+            shift 1
+            ;;
+        --help)
+            usage
+            exit
+            ;;
+        --)
+            shift 1
+            break;
+            ;;
+        -*)
+            echo "Unrecognized option '$1'" >&2
+            usage >&2
+            exit 1
+            ;;
+        *)
+            if ! test -f $1; then
+                echo "Could not find configurator script '$1'" >&2
+                exit 1
+            fi
+            break
+            ;;
+    esac
+done
+
+if test $# -eq 0; then
+    exit 1
+fi
+
+"${PYTHON}" ${PYTHON_ARGS} "$@"

-----------------------------------------------------------------------


-- 
asterisk-scf/integration/gitall.git



More information about the asterisk-scf-commits mailing list