vdr/vdr/debian plugin-loader.sh
Tobias Grimm
pkg-vdr-dvb-changes@lists.alioth.debian.org
Thu, 07 Oct 2004 21:51:25 +0000
Update of /cvsroot/pkg-vdr-dvb/vdr/vdr/debian
In directory haydn:/tmp/cvs-serv10923
Modified Files:
plugin-loader.sh
Log Message:
added output of vdr version, corrected indentations (by Thomas Gümther)
Index: plugin-loader.sh
===================================================================
RCS file: /cvsroot/pkg-vdr-dvb/vdr/vdr/debian/plugin-loader.sh,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- plugin-loader.sh 3 Oct 2004 17:45:48 -0000 1.15
+++ plugin-loader.sh 7 Oct 2004 21:51:23 -0000 1.16
@@ -15,31 +15,32 @@
local leftout
local leftout2
local version
-
- version=`/usr/bin/vdr -V 2>/dev/null | grep '^vdr[- ]' | sed -e 's/.*(\(.*\)).*/\1/'`
+ version=`/usr/bin/vdr -V -P- 2>/dev/null | sed -e 's/.*(\(.*\)).*/\1/'`
+ test "$version" || version="unknown version"
+
PLUGINS=""
-
- echo -ne "\nSearching for plugins:"
-
+
+ echo -ne "\nSearching for plugins (VDR $version):"
+
# 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 [ "$PLUGIN_CHECK_PATCHLEVEL" == "yes" ]; then
- # extract patchlevel info
+ # extract patchlevel info
packages=( "vdr" "${installed_plugins[@]/#/vdr-plugin-}" )
- eval "patchlevels=( "`LANG=en;dpkg -s ${packages[@]} 2>&1 | awk -F ':' '/^Package: / {p=$2} /^Package.*is not installed/ {print "\"\""} (/[pP]atchlevel:/ || /^$/) && p!="" {print "\""$2"\"";p=""}'`" )"
+ eval "patchlevels=( "`LANG=en;dpkg -s ${packages[@]} 2>&1 | awk -F ':' '/^Package: / {p=$2} /^Package.*is not installed/ {print "\"\""} (/[pP]atchlevel:/ || /^$/) && p!="" {print "\""$2"\"";p=""}'`" )"
- # move plugins with incompatible patchlevel to $leftout
- for (( i=1 ; i<${#patchlevels[@]} ; i++ )); do
- if [ "${patchlevels[0]}" != "${patchlevels[$i]}" ]; then
- leftout="${leftout} ${installed_plugins[$((i-1))]}"
- unset installed_plugins[$((i-1))]
- fi
- done
+ # move plugins with incompatible patchlevel to $leftout
+ for (( i=1 ; i<${#patchlevels[@]} ; i++ )); do
+ if [ "${patchlevels[0]}" != "${patchlevels[$i]}" ]; then
+ leftout="${leftout} ${installed_plugins[$((i-1))]}"
+ unset installed_plugins[$((i-1))]
+ fi
+ done
- # cleanup the installed_plugins array
- installed_plugins=( "${installed_plugins[@]}" )
+ # cleanup the installed_plugins array
+ installed_plugins=( "${installed_plugins[@]}" )
fi
if [ "$PLUGIN_CHECK_STARTABLE" == "yes" ]; then
@@ -58,25 +59,25 @@
fi
if [ -r "$PLUGIN_CFG_DIR/order.conf" ]; then
- # load plugin order
- plugin_order=( `cat $PLUGIN_CFG_DIR/order.conf | sed "s/#.*$//"` )
+ # load plugin order
+ plugin_order=( `cat $PLUGIN_CFG_DIR/order.conf | sed "s/#.*$//"` )
- # move ordered plugins to list of ordered plugins
- for plugin in ${plugin_order[@]}; do
- for (( i=0 ; i<${#installed_plugins[@]} ; i++ )); do
- if [ "$plugin" == "-${installed_plugins[$i]}" ]; then
- unset installed_plugins[$i]
- installed_plugins=( "${installed_plugins[@]}" )
- break
- fi
- if [ "$plugin" == "${installed_plugins[$i]}" ]; then
- ordered_plugins=( "${ordered_plugins[@]}" "$plugin" )
- unset installed_plugins[$i]
- installed_plugins=( "${installed_plugins[@]}" )
- break
- fi
- done
- done
+ # move ordered plugins to list of ordered plugins
+ for plugin in ${plugin_order[@]}; do
+ for (( i=0 ; i<${#installed_plugins[@]} ; i++ )); do
+ if [ "$plugin" == "-${installed_plugins[$i]}" ]; then
+ unset installed_plugins[$i]
+ installed_plugins=( "${installed_plugins[@]}" )
+ break
+ fi
+ if [ "$plugin" == "${installed_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
@@ -88,8 +89,8 @@
if [ -r "$PLUGIN_CFG_DIR/plugin.$plugin.conf" ] ; then
arguments=( `cat $PLUGIN_CFG_DIR/plugin.$plugin.conf | sed "s/#.*$//"` )
PLUGINS="$PLUGINS -P \"$plugin ${arguments[*]}\""
- else
- PLUGINS="$PLUGINS -P $plugin"
+ else
+ PLUGINS="$PLUGINS -P $plugin"
fi
done