summaryrefslogtreecommitdiff
path: root/plugins/autosort
diff options
context:
space:
mode:
authorroot <root@elwms02.(none)>2010-04-06 16:13:08 +0200
committerroot <root@elwms02.(none)>2010-04-06 16:13:08 +0200
commit0e7005fcc7483c01aa102fbea358c5ac65a48d62 (patch)
tree11517ce0d3d2977c6732b3aa583b0008083e0bd3 /plugins/autosort
downloadx-vdr-0e7005fcc7483c01aa102fbea358c5ac65a48d62.tar.gz
x-vdr-0e7005fcc7483c01aa102fbea358c5ac65a48d62.tar.bz2
hello world
Diffstat (limited to 'plugins/autosort')
-rw-r--r--plugins/autosort/_plugin.sh57
-rw-r--r--plugins/autosort/autosort-0.1.3-configdir.diff112
-rw-r--r--plugins/autosort/plugin.sh56
3 files changed, 225 insertions, 0 deletions
diff --git a/plugins/autosort/_plugin.sh b/plugins/autosort/_plugin.sh
new file mode 100644
index 0000000..8ce2bf7
--- /dev/null
+++ b/plugins/autosort/_plugin.sh
@@ -0,0 +1,57 @@
+#!/bin/sh
+
+# x-vdr (Installations-Skript fuer einen VDR mit Debian als Basis)
+# von Marc Wernecke - www.zulu-entertainment.de
+# 17.01.2008
+#
+# vdr-autosort
+
+# defaults
+source ./../../x-vdr.conf
+source ./../../setup.conf
+source ./../../functions
+
+WEB="http://www.zulu-entertainment.de/files/vdr-autosort/vdr-autosort-0.1.3.tgz"
+VERSION="autosort-0.1.3"
+LINK="autosort"
+
+VAR=`basename $WEB`
+DIR=`pwd`
+
+# plugin entfernen
+function clean_plugin() {
+ cd $SOURCEDIR/VDR/PLUGINS/src
+ rm -rf $LINK*
+ rm -f $VDRLIBDIR/libvdr-$LINK*
+ log "cleaning $LINK"
+}
+
+# plugin installieren
+function install_plugin() {
+ download_plugin
+ extract_plugin
+ cd $SOURCEDIR/VDR/PLUGINS/src
+ rm -f $LINK
+ ln -vfs $VERSION $LINK
+ patch_plugin
+
+ ## plugin specials - start ##
+ if [ -f $DIR/autosort.conf ]; then
+ cp -f $DIR/autosort.conf $VDRCONFDIR/plugins
+ else
+ cp -f $SOURCEDIR/VDR/PLUGINS/src/$LINK/examples/autosort.conf $VDRCONFDIR/plugins
+ fi
+ chown $VDRUSER:$VDRGROUP $VDRCONFDIR/plugins/autosort.conf
+ ## plugin specials - ende ##
+}
+
+# plugin commands
+if [ $# \> 0 ]; then
+ cmd=$1
+ cmd_plugin
+else
+ install_plugin
+ log "install-plugin fuer $VERSION ist fertig"
+fi
+
+exit 0
diff --git a/plugins/autosort/autosort-0.1.3-configdir.diff b/plugins/autosort/autosort-0.1.3-configdir.diff
new file mode 100644
index 0000000..6d74e0d
--- /dev/null
+++ b/plugins/autosort/autosort-0.1.3-configdir.diff
@@ -0,0 +1,112 @@
+diff -ruNp autosort-0.1.3/autogroup.c autosort-0.1.3-patched/autogroup.c
+--- autosort-0.1.3/autogroup.c 2007-03-18 13:35:47.000000000 +0100
++++ autosort-0.1.3-patched/autogroup.c 2008-01-17 15:06:59.000000000 +0100
+@@ -211,8 +211,7 @@ bool cAutoGroup::Parse(const char *line)
+
+ // check for additional config files
+ char *buf;
+-// asprintf(&buf, "%s/%s/%s",cPlugin::ConfigDirectory(),"autosort",name );
+- asprintf(&buf, "%s/%s/%s",ConfigDir,"autosort",name );
++ asprintf(&buf, "%s/%s", ConfigDir, name);
+
+
+ if (access(buf, R_OK) == 0) {
+@@ -404,8 +403,7 @@ void cAutoGroup::ModifyChannelToGroup (i
+ if (!Out) { // channel will go into group
+ if (saveDelete) {
+ FILE *f;
+-// char *fileName = strdup( AddDirectory(cPlugin::ConfigDirectory(), "../channels.deleted"));
+- char *fileName = strdup( AddDirectory(ConfigDir, "../channels.deleted"));
++ char *fileName = strdup(AddDirectory(ConfigDir, "../../channels.deleted"));
+ f = fopen(fileName , "a");
+ if (!f) {
+ LOG_ERROR_STR(fileName);
+diff -ruNp autosort-0.1.3/autogroups.c autosort-0.1.3-patched/autogroups.c
+--- autosort-0.1.3/autogroups.c 2007-02-07 17:22:24.000000000 +0100
++++ autosort-0.1.3-patched/autogroups.c 2008-01-17 15:01:04.000000000 +0100
+@@ -72,7 +72,6 @@ bool cAutoGroups::Load(const char *FileN
+ ReIndex();
+ return true;
+ }
+-// esyslog("Auto Sort: -ERROR- Can't find %s/autosort.conf -EXITING-",cPlugin::ConfigDirectory());
+ esyslog("Auto Sort: -ERROR- Can't find %s/autosort.conf -EXITING-",ConfigDir);
+ esyslog(" !!! Check your autosort.conf !!!");
+ return false;
+diff -ruNp autosort-0.1.3/autosort.c autosort-0.1.3-patched/autosort.c
+--- autosort-0.1.3/autosort.c 2007-02-07 17:23:13.000000000 +0100
++++ autosort-0.1.3-patched/autosort.c 2008-01-17 14:23:48.000000000 +0100
+@@ -12,6 +12,8 @@ static const char *VERSION = "0.1
+ static const char *DESCRIPTION = "Channel AutoSort";
+ static const char *MAINMENUENTRY = "AutoSort Restart";
+
++char *ConfigDir = NULL;
++
+ class cPluginAutoSort : public cPlugin {
+ private:
+ // Add any member variables or functions you may need here.
+@@ -50,6 +52,7 @@ cPluginAutoSort::cPluginAutoSort(void)
+ cPluginAutoSort::~cPluginAutoSort()
+ {
+ // Clean up after yourself!
++ if (ConfigDir) free(ConfigDir);
+ }
+
+ const char *cPluginAutoSort::MainMenuEntry(void)
+@@ -81,6 +84,8 @@ bool cPluginAutoSort::Initialize(void)
+ bool cPluginAutoSort::Start(void)
+ {
+ // Start any background activities the plugin shall perform.
++ if (!ConfigDir)
++ ConfigDir = strdup(cPlugin::ConfigDirectory("autosort"));
+ cAutoSortMainThread::Init();
+ return true;
+ }
+diff -ruNp autosort-0.1.3/autosort_main_thread.c autosort-0.1.3-patched/autosort_main_thread.c
+--- autosort-0.1.3/autosort_main_thread.c 2007-03-18 08:28:37.000000000 +0100
++++ autosort-0.1.3-patched/autosort_main_thread.c 2008-01-17 15:02:17.000000000 +0100
+@@ -54,7 +54,6 @@ void cAutoSortMainThread::Stop(void) {
+ void cAutoSortMainThread::Action(void)
+ {
+ OpenGroups.Load();
+-// AutoGroups.Load(AddDirectory(cPlugin::ConfigDirectory(), "autosort.conf"), true, true);
+ AutoGroups.Load(AddDirectory(ConfigDir, "autosort.conf"), true, true);
+ m_Active = true;
+ CheckDelimiters();
+diff -ruNp autosort-0.1.3/autosort_menu.c autosort-0.1.3-patched/autosort_menu.c
+--- autosort-0.1.3/autosort_menu.c 2007-03-18 09:57:10.000000000 +0100
++++ autosort-0.1.3-patched/autosort_menu.c 2008-01-17 14:09:40.000000000 +0100
+@@ -35,9 +35,6 @@ int lastDuration = 0;
+ int averageDuration = 0;
+ int activeChannel = 0;
+
+-const char *ConfigDir = cPlugin::ConfigDirectory();
+-
+-
+
+ cASInfoItem::cASInfoItem(const char *Text)
+ {
+diff -ruNp autosort-0.1.3/autosort_menu.h autosort-0.1.3-patched/autosort_menu.h
+--- autosort-0.1.3/autosort_menu.h 2007-02-07 17:11:00.000000000 +0100
++++ autosort-0.1.3-patched/autosort_menu.h 2008-01-17 14:07:04.000000000 +0100
+@@ -37,7 +37,7 @@ extern int lastDuration;
+ extern int averageDuration;
+ extern int activeChannel;
+
+-extern const char *ConfigDir;
++extern char *ConfigDir;
+
+
+ /*
+diff -ruNp autosort-0.1.3/opengroups.c autosort-0.1.3-patched/opengroups.c
+--- autosort-0.1.3/opengroups.c 2007-02-07 17:27:52.000000000 +0100
++++ autosort-0.1.3-patched/opengroups.c 2008-01-17 15:03:17.000000000 +0100
+@@ -40,8 +40,7 @@ bool cOpenGroups::Load(void)
+ {
+ char *buf;
+ char *option;
+-// asprintf(&buf, "%s/%s/%s",cPlugin::ConfigDirectory(),"autosort","opengroups.conf" );
+- asprintf(&buf, "%s/%s/%s",ConfigDir,"autosort","opengroups.conf" );
++ asprintf(&buf, "%s/opengroups.conf", ConfigDir);
+ if (access(buf, R_OK) == 0) {
+ dsyslog ("loading %s", buf);
+ FILE *f = fopen(buf, "r");
diff --git a/plugins/autosort/plugin.sh b/plugins/autosort/plugin.sh
new file mode 100644
index 0000000..49b84ec
--- /dev/null
+++ b/plugins/autosort/plugin.sh
@@ -0,0 +1,56 @@
+#!/bin/sh
+
+# x-vdr (Installations-Skript fuer einen VDR mit Debian als Basis)
+# von Marc Wernecke - www.zulu-entertainment.de
+# 05.05.2008
+#
+# vdr-autosort
+
+# defaults
+source ./../../x-vdr.conf
+source ./../../setup.conf
+source ./../../functions
+
+WEB="http://vdr-wiki.de/vdr/vdr-autosort/vdr-autosort-0.0.10.tgz"
+VERSION="autosort-0.0.10"
+LINK="autosort"
+
+VAR=`basename $WEB`
+DIR=`pwd`
+
+# plugin entfernen
+function clean_plugin() {
+ cd $SOURCEDIR/VDR/PLUGINS/src
+ rm -rf $LINK*
+ rm -f $VDRLIBDIR/libvdr-$LINK*
+ log "cleaning $LINK"
+}
+
+# plugin installieren
+function install_plugin() {
+ download_plugin
+ extract_plugin
+ cd $SOURCEDIR/VDR/PLUGINS/src
+ rm -f $LINK
+ ln -vfs $VERSION $LINK
+ patch_plugin
+
+ ## plugin specials - start ##
+ if [ -f $DIR/autosort.conf ]; then
+ cp -f $DIR/autosort.conf $VDRCONFDIR/plugins
+ else
+ cp -f $SOURCEDIR/VDR/PLUGINS/src/$LINK/autosort.conf $VDRCONFDIR/plugins
+ fi
+ ## plugin specials - ende ##
+}
+
+# plugin commands
+if [ $# \> 0 ]; then
+ cmd=$1
+ cmd_plugin
+else
+ install_plugin
+ log "install-plugin fuer $VERSION ist fertig"
+fi
+
+exit 0