summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2011-01-21 05:30:47 +0000
committerShaun Ruffell <sruffell@digium.com>2011-01-21 05:30:47 +0000
commit7201e8858ba81d45e2a8f347341f3a224de30939 (patch)
treedeed18c64e09cc989f14e8427d374e30c8ce2039
parent774376d6d6093914ada1cb7f1af3b091b314cd4f (diff)
live_dahdi: only check for TOOLS_DIR when used
Only check that TOOLD_DIR is valid when it is actually needed (configure, install, config). This allows not checking for it with *load on a rsync-ed copy. Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=9479 git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.4@9677 a0bf4364-ded3-4de4-8d8a-66a801d63aff
-rwxr-xr-xbuild_tools/live_dahdi16
1 files changed, 11 insertions, 5 deletions
diff --git a/build_tools/live_dahdi b/build_tools/live_dahdi
index d23e46d..4a9f20a 100755
--- a/build_tools/live_dahdi
+++ b/build_tools/live_dahdi
@@ -29,13 +29,16 @@ if [ ! -d "$LINUX_DIR" ]; then
exit 1
fi
-if [ ! -d "$TOOLS_DIR" ]; then
- echo >&2 "$0:dahdi-tools dir '$TOOLS_DIR' does not exits. Aborting".
- exit 1
-fi
set -e
LINUX_DIR_FULL=`(cd $LINUX_DIR; pwd)`
-TOOLS_DIR_FULL=`(cd $TOOLS_DIR; pwd)`
+
+set_tools_dir() {
+ if [ ! -d "$TOOLS_DIR" ]; then
+ echo >&2 "$0:dahdi-tools dir '$TOOLS_DIR' does not exits. Aborting".
+ exit 1
+ fi
+ TOOLS_DIR_FULL=`(cd $TOOLS_DIR; pwd)`
+}
# Give priority to our installed binaries:
PATH=$DESTDIR/sbin:$DESTDIR/usr/sbin:$PATH
@@ -227,15 +230,18 @@ usage() {
case "$1" in
configure)
shift
+ set_tools_dir
cd "$TOOLS_DIR"; ./configure --with-dahdi="$LINUX_DIR_FULL" "$@"
;;
install)
shift
+ set_tools_dir
cd "$LINUX_DIR"; make install DESTDIR=$DESTDIR "$@"
cd "$TOOLS_DIR_FULL"; make install DESTDIR=$DESTDIR DYNFS=yes "$@"
;;
config)
shift
+ set_tools_dir
cd "$TOOLS_DIR"; make config DESTDIR=$DESTDIR "$@"
mkdir -p $DESTDIR/etc/asterisk
cat >"$FIRMWARE_DIR/live-init.conf" <<EOF