r4067 - in vdr/vdr-plugin-radio/trunk/debian: . patches
Tobias Grimm
tiber-guest at alioth.debian.org
Wed Jan 17 01:17:45 CET 2007
Author: tiber-guest
Date: 2007-01-17 01:17:45 +0100 (Wed, 17 Jan 2007)
New Revision: 4067
Modified:
vdr/vdr-plugin-radio/trunk/debian/changelog
vdr/vdr-plugin-radio/trunk/debian/patches/02_radio-0.1.1-fix-DataDir.dpatch
vdr/vdr-plugin-radio/trunk/debian/plugin.radio.conf
Log:
* NOT RELEASED YET
* Modified 02_radio-0.1.1-fix-DataDir to create DataDir also when
saving mpeg stills and made default DataDir = /tmp/radio.XXXXXX
* Dropped --data parameter from default config file
Modified: vdr/vdr-plugin-radio/trunk/debian/changelog
===================================================================
--- vdr/vdr-plugin-radio/trunk/debian/changelog 2007-01-17 00:14:49 UTC (rev 4066)
+++ vdr/vdr-plugin-radio/trunk/debian/changelog 2007-01-17 00:17:45 UTC (rev 4067)
@@ -1,3 +1,12 @@
+vdr-plugin-radio (0.2.0-2) UNRELEASED; urgency=low
+
+ * NOT RELEASED YET
+ * Modified 02_radio-0.1.1-fix-DataDir to create DataDir also when
+ saving mpeg stills and made default DataDir = /tmp/radio.XXXXXX
+ * Dropped --data parameter from default config file
+
+ -- Tobias Grimm <tg at e-tobi.net> Sun, 14 Jan 2007 21:05:17 +0100
+
vdr-plugin-radio (0.2.0-1) experimental; urgency=low
[ Tobias Grimm ]
Modified: vdr/vdr-plugin-radio/trunk/debian/patches/02_radio-0.1.1-fix-DataDir.dpatch
===================================================================
--- vdr/vdr-plugin-radio/trunk/debian/patches/02_radio-0.1.1-fix-DataDir.dpatch 2007-01-17 00:14:49 UTC (rev 4066)
+++ vdr/vdr-plugin-radio/trunk/debian/patches/02_radio-0.1.1-fix-DataDir.dpatch 2007-01-17 00:17:45 UTC (rev 4067)
@@ -3,29 +3,96 @@
## http://toms-cafe.de/vdr/download/radio-0.1.1-fix-DataDir.diff
##
## All lines beginning with `## DP:' are a description of the patch.
-## DP: Fixes crash if DataDir not exist.
+## DP: Fixes problems if DataDir not exist.
+## DP:
+## DP: 2007-01-17 Tobias Grimm <tg at e-tobi.net>
+## DP: - Enforce creation of temp data dir also when saving mpeg stills
+## DP: - When no DataDir argument is passed, create temp dir /tmp/radio.XXXXXX
@DPATCH@
---- radio-0.1.1/radioaudio.c
-+++ radio-0.1.1/radioaudio.c
-@@ -1157,6 +1157,20 @@
+diff -urNad vdr-plugin-radio-0.2.0~/radio.c vdr-plugin-radio-0.2.0/radio.c
+--- vdr-plugin-radio-0.2.0~/radio.c 2006-12-28 14:41:33.000000000 +0100
++++ vdr-plugin-radio-0.2.0/radio.c 2007-01-17 00:29:57.000000000 +0100
+@@ -429,7 +429,10 @@
+ if (!ConfigDirParam)
+ ConfigDir = strdup(ConfigDirectory(Name()));
+ if (!DataDirParam)
+- DataDir = strdup(ConfigDirectory(Name()));
++ {
++ char* tmp_template = "/tmp/radio.XXXXXX";
++ DataDir = strdup(mkdtemp(tmp_template));
++ }
+ if (!LiveFileParam)
+ asprintf(&LiveFile, "%s/radio.mpg", ConfigDir);
+ if (!ReplayFileParam)
+diff -urNad vdr-plugin-radio-0.2.0~/radioaudio.c vdr-plugin-radio-0.2.0/radioaudio.c
+--- vdr-plugin-radio-0.2.0~/radioaudio.c 2007-01-16 23:55:06.000000000 +0100
++++ vdr-plugin-radio-0.2.0/radioaudio.c 2007-01-17 00:06:43.000000000 +0100
+@@ -1016,7 +1016,7 @@
+ }
+
+ // show & save file ?
+- if (index == filemax) {
++ if ((index == filemax) && enforce_directory(DataDir)) {
+ if (slideshow || (slidecan && QDar_Show == -1)) {
+ if (filetype == 1) { // show only mpeg-still
+ char *filepath;
+@@ -1926,6 +1926,11 @@
char *fname, *fpath;
FILE *fd;
int ind, lfd = 0;
++
++ if (!enforce_directory(DataDir))
++ {
++ return;
++ }
+
+ time_t t = time(NULL);
+ ts = localtime_r(&t, &tm_store);
+diff -urNad vdr-plugin-radio-0.2.0~/radiotools.c vdr-plugin-radio-0.2.0/radiotools.c
+--- vdr-plugin-radio-0.2.0~/radiotools.c 2007-01-16 23:55:06.000000000 +0100
++++ vdr-plugin-radio-0.2.0/radiotools.c 2007-01-17 00:06:08.000000000 +0100
+@@ -9,6 +9,8 @@
+ #include "radiotools.h"
+ #include <string.h>
+ #include <stdio.h>
++#include <sys/stat.h>
++#include <vdr/tools.h>
+
+ /* for timetest */
+ //#include <time.h>
+@@ -50,5 +52,24 @@
+ return text;
+ }
+
++bool enforce_directory(const char* path)
++{
+ struct stat sbuf;
-+ if (stat(DataDir, &sbuf) != 0) {
-+ dsyslog("vdr-radio: creating directory %s", DataDir);
-+ if (mkdir(DataDir, ACCESSPERMS)) {
-+ esyslog("ERROR: Failed to create directory %s", DataDir);
-+ return;
++ if (stat(path, &sbuf) != 0) {
++ dsyslog("vdr-radio: creating directory %s", path);
++ if (mkdir(path, ACCESSPERMS)) {
++ esyslog("ERROR: Failed to create directory %s", path);
++ return false;
+ }
+ }
+ else {
+ if (!S_ISDIR(sbuf.st_mode)) {
-+ esyslog("ERROR: Failed to create directory %s: file exists but is not a directory", DataDir);
-+ return;
++ esyslog("ERROR: Failed to create directory %s: file exists but is not a directory", path);
++ return false;
+ }
+ }
++
++ return true;
++}
- time_t t = time(NULL);
- ts = localtime(&t);
+ //--------------- End -----------------------------------------------------------------
+diff -urNad vdr-plugin-radio-0.2.0~/radiotools.h vdr-plugin-radio-0.2.0/radiotools.h
+--- vdr-plugin-radio-0.2.0~/radiotools.h 2007-01-16 23:55:06.000000000 +0100
++++ vdr-plugin-radio-0.2.0/radiotools.h 2007-01-17 00:06:20.000000000 +0100
+@@ -6,4 +6,6 @@
+
+ char *rtrim(char *text);
+
++bool enforce_directory(const char* path);
++
+ #endif //__RADIO_TOOLS_H
Modified: vdr/vdr-plugin-radio/trunk/debian/plugin.radio.conf
===================================================================
--- vdr/vdr-plugin-radio/trunk/debian/plugin.radio.conf 2007-01-17 00:14:49 UTC (rev 4066)
+++ vdr/vdr-plugin-radio/trunk/debian/plugin.radio.conf 2007-01-17 00:17:45 UTC (rev 4067)
@@ -1,13 +1,12 @@
#
# vdr-plugin-radio configuration file
#
+# see /usr/share/doc/vdr-plugin-radio
+#
# image directory
--files=/usr/share/vdr-plugin-radio
-# temp. data directory
---data=/tmp/radio
-
# default mpegfile in livemode
--live=/usr/share/vdr-plugin-radio/rtextUnten-kleo2-live.mpg
More information about the pkg-vdr-dvb-changes
mailing list