[svn-commits] tzafrir: branch 1.4 r3607 - /branches/1.4/live_zap

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Jan 3 17:37:54 CST 2008


Author: tzafrir
Date: Thu Jan  3 17:37:53 2008
New Revision: 3607

URL: http://svn.digium.com/view/zaptel?view=rev&rev=3607
Log:
* Use inline perl to get list of module instead of script from xpp/utils,
  as xpp/utils is not copied to remote rsync copy.
* Make sure we set environment early enough to run perl code.

Modified:
    branches/1.4/live_zap

Modified: branches/1.4/live_zap
URL: http://svn.digium.com/view/zaptel/branches/1.4/live_zap?view=diff&rev=3607&r1=3606&r2=3607
==============================================================================
--- branches/1.4/live_zap (original)
+++ branches/1.4/live_zap Thu Jan  3 17:37:53 2008
@@ -8,7 +8,6 @@
 XPP_SYNC=auto
 AST_SCRIPT=/etc/init.d/asterisk
 # Use this file to pass options to modules:
-MODPROBE_FILE=$DESTDIR/modprobe.conf
 PERLLIBDIR=`perl -V:sitelib | cut -d "'" -f 2`
 
 # Manual list of modules. They will be loaded by insmod.
@@ -23,8 +22,25 @@
 
 if [ -r $DESTDIR/live.conf ]; then . $DESTDIR/live.conf; fi
 
+# Give priority to our installed binaries:
+PATH=$DESTDIR/sbin:$DESTDIR/usr/sbin:$PATH
+export PATH
+
+# TODO: If you already use PERL5DIR, please fix this part:
+PERL5LIB="$DESTDIR/$PERLLIBDIR"
+export PERL5LIB
+
+# the same as xpp/utils/zaptel_drivers .
+# With the remote mode, I can't rely on files in the source directory.
+zaptel_drivers() {
+	perl -MZaptel::Hardware -e '
+		my $hardware = Zaptel::Hardware->scan;
+		print join(" ", $hardware->drivers);
+		'
+}
+
 # Detect the modules used in the system:
-for mod in `xpp/utils/zaptel_drivers`; do
+for mod in `zaptel_drivers`; do
 	case "$mod" in
 		xpp_usb) 
 			MODULES_LOAD="$MODULES_LOAD xpp/xpp xpp/xpd_fxs"
@@ -99,14 +115,6 @@
 	echo "$me load       /etc/init.d/zaptel start"
 }
 
-# Give priority to our installed binaries:
-PATH=$DESTDIR/sbin:$DESTDIR/usr/sbin:$PATH
-export PATH
-
-# TODO: If you already use PERL5DIR, please fix this part:
-PERL5LIB="$DESTDIR/$PERLLIBDIR"
-export PERL5LIB
-
 case "$1" in
 install)
 	shift
@@ -115,7 +123,6 @@
 config)
 	shift
 	make config DESTDIR=$DESTDIR "$@"
-	touch $MODPROBE_FILE
 	mkdir -p $DESTDIR/etc/asterisk
 	;;
 rsync)




More information about the svn-commits mailing list