vdr/vdr/debian vdr.init
Tobias Grimm
pkg-vdr-dvb-changes@lists.alioth.debian.org
Sun, 25 Apr 2004 11:11:14 +0000
Update of /cvsroot/pkg-vdr-dvb/vdr/vdr/debian
In directory haydn:/tmp/cvs-serv19894
Modified Files:
vdr.init
Log Message:
order plugins only if order.conf exists
Index: vdr.init
===================================================================
RCS file: /cvsroot/pkg-vdr-dvb/vdr/vdr/debian/vdr.init,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- vdr.init 25 Apr 2004 11:02:06 -0000 1.8
+++ vdr.init 25 Apr 2004 11:11:10 -0000 1.9
@@ -42,27 +42,33 @@
local i
local arguments
+
echo -n "Seeking plugins: "
- # generate data structures
- plugin_order=( `cat $PLUGIN_ORDER_FILE | sed "s/#.*$//"` )
+ # find installed plugins
installed_plugins=( `find $PLUGIN_DIR -maxdepth 1 -name "$PLUGIN_PREFIX*.so.$VERSION" -printf "%f " | sed "s/$PLUGIN_PREFIX\([^\.]\+\)\.so\.$VERSION/\1/g"` )
+
+ if [ -r $PLUGIN_ORDER_FILE ]; then
+ # load plugin order
+ plugin_order=( `cat $PLUGIN_ORDER_FILE | sed "s/#.*$//"` )
- # generate list of plugins with a fixed order:
- for plugin in ${plugin_order[@]}; do
- for (( i=0 ; i<${#installed_plugins[@]} ; i++ )); do
- if [ "$plugin" == "${inctalled_plugins[$i]}" ]; then
- ordered_plugins=( "${ordered_plugins[@]}" "$plugin" )
- unset installed_plugins[$i]
- installed_plugins=( "${installed_plugins[@]}" )
- break
- fi
- done
- done
- # then the remaining unordered plugins
+ # move ordered plugins to list of ordered plugins
+ for plugin in ${plugin_order[@]}; do
+ for (( i=0 ; i<${#installed_plugins[@]} ; i++ )); do
+ if [ "$plugin" == "${inctalled_plugins[$i]}" ]; then
+ ordered_plugins=( "${ordered_plugins[@]}" "$plugin" )
+ unset installed_plugins[$i]
+ installed_plugins=( "${installed_plugins[@]}" )
+ break
+ fi
+ done
+ done
+ fi
+
+ # append unordered to ordered plugins
ordered_plugins=( "${ordered_plugins[@]}" "${installed_plugins[@]}" )
- # add the command line arguments
+ # add the command line arguments for each plugin
for plugin in ${ordered_plugins[@]}; do
echo -n "$plugin "
PLUGINS="$PLUGINS -P $plugin"