[asterisk-commits] tzafrir: trunk r263250 - /trunk/contrib/scripts/live_ast
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Sun May 16 11:31:38 CDT 2010
Author: tzafrir
Date: Sun May 16 11:31:34 2010
New Revision: 263250
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=263250
Log:
live_ast: add commands 'rsync' and 'gen-live-asterisk'
This adds the following two commands to live_ast:
* rsync [user]@host directory
Copy over all generated files to <directory> at remote host.
Would allow running live_ast there. Hence allows separating a build
machine from a test machine.
* gen-live-asteris: regenerate live/asterisk . Useful if copying over
files to a different directory.
Modified:
trunk/contrib/scripts/live_ast
Modified: trunk/contrib/scripts/live_ast
URL: http://svnview.digium.com/svn/asterisk/trunk/contrib/scripts/live_ast?view=diff&rev=263250&r1=263249&r2=263250
==============================================================================
--- trunk/contrib/scripts/live_ast (original)
+++ trunk/contrib/scripts/live_ast Sun May 16 11:31:34 2010
@@ -165,6 +165,16 @@
mkdir -p $BASE_DIR
sed -n -e '/^#* Begin Samples/,/^#* End Samples/p' "$0" \
| sed -e '/^#* \(Begin\|End\) Samples/d' >"$LIVE_CONF"
+}
+
+# (re?)generate the ./live/asterisk wrapper script
+gen_live_asterisk() {
+ cat <<EOF >"$BASE_DIR/asterisk"
+#!/bin/sh
+# a wrapper to run asterisk from the "live" copy:
+cd "$PWD"
+exec "$0" run "\$@"
+EOF
}
command="$1"
@@ -212,12 +222,7 @@
cat <<EOF >"$GDB_INIT"
set args -C "$AST_CONF" -c
EOF
-cat <<EOF >"$BASE_DIR/asterisk"
-#!/bin/sh
-# a wrapper to run asterisk from the "live" copy:
-cd "$PWD"
-exec "$0" run "\$@"
-EOF
+ gen_live_asterisk
chmod +x "$BASE_DIR/asterisk"
# Generate a sample config file for live_ast itself:
gen_live_conf
@@ -229,6 +234,20 @@
run)
set_ld_env
$AST_BIN -C $AST_CONF "$@"
+ ;;
+rsync)
+ remote_host="$1"
+ remote_dir="$2"
+ me=`basename $0`
+ # FIXME: assumes varrundir is /var/run/asterisk
+ rsync -ai "$0" \
+ --exclude '/live/asterisk' \
+ --exclude '/live/var/run/asterisk/*' --exclude '/live/var/log/asterisk/*' \
+ live "$remote_host:$remote_dir/"
+ ssh $remote_host "cd '$remote_dir' && ./$me gen-live-asterisk"
+ ;;
+gen-live-asterisk)
+ gen_live_asterisk
;;
gdb)
set_ld_env
@@ -243,6 +262,8 @@
echo "$0 samples make samples"
echo "$0 run [params] asterisk [params]"
echo "$0 gdb gdb asterisk"
+ echo "$0 rsync [user@]host dir copy files over to [user@]host:dir"
+ echo "$0 gen-live-asterisk regenerate the wrapper ./live/asterisk"
echo "$0 conf-file create live.conf if it does exist"
exit 1
;;
More information about the asterisk-commits
mailing list