Failed to read channels.conf after adding transponder

Message ID 48C2923E.9080008@cadsoft.de
State New
Headers

Commit Message

Klaus Schmidinger Sept. 6, 2008, 2:22 p.m. UTC
  On 06/18/08 15:12, Tim wrote:
> Am Mittwoch 18 Juni 2008 schrieb Frank Scherthan:
>> Hi
>>
>> Hanno Zulla schrieb:
>>>> Is there an easy fix I could test right now? Can I disable the
>>>> channel-checking?
>>> Yes, you can. Check the DVB settings menu.
>> You are wrong. I am not talking about *updating channels*.
>> I know about that and as a workaround, I switched it off.
>> BUT:
>> This is NOT what I am looking for.
>>
>> I want to disable the check, for invalid channels in channels.conf
>> I just don't care, if a channel is not "tuneable".
> in config.h, in the function "bool Load()" at about line 123 (vdr 1.4.7) 
> uncomment 2 lines:
>                    else {
>                       esyslog("ERROR: error in %s, line %d", fileName, line);
>                       delete l;
>                       //RC: we do not want to exit vdr just because of a 
> simple error
>                       //result = false;
>                       //break;
>                       }
>                    }
>                 }
> this will cause vdr to go on starting even if an error accours in a config 
> file and increase waf. ;)

Since this kind of complaints keeps occuring ever again, I guess it's best
to simply report errors when reading config files (as suggested by Tim)



Of course Tim's change would have had the same result, but it also would
have made it completely impossible for the caller of cConfig::Load() to
determine if the call was successful.

Well, whether this actually increases the WAF remains to be seen. Starting
VDR with inconsistent config files may have all kinds of effects...

Klaus
  

Comments

Ville Skyttä Sept. 6, 2008, 4:38 p.m. UTC | #1
On Saturday 06 September 2008, Klaus Schmidinger wrote:
>
> Since this kind of complaints keeps occuring ever again, I guess it's best
> to simply report errors when reading config files (as suggested by Tim)
[...]

Somewhat related - I'm wondering why comments are not allowed in 
channels.conf, remote.conf, setup.conf and timers.conf?

Or actually more generally why an option for disallowing comments in some 
*.conf files exists in the first place :)
  
Klaus Schmidinger Sept. 6, 2008, 4:56 p.m. UTC | #2
On 09/06/08 18:38, Ville Skyttä wrote:
> On Saturday 06 September 2008, Klaus Schmidinger wrote:
>> Since this kind of complaints keeps occuring ever again, I guess it's best
>> to simply report errors when reading config files (as suggested by Tim)
> [...]
> 
> Somewhat related - I'm wondering why comments are not allowed in 
> channels.conf, remote.conf, setup.conf and timers.conf?
> 
> Or actually more generally why an option for disallowing comments in some 
> *.conf files exists in the first place :)

Some files are "human written" and will not be overwritten by VDR.
In those files comments make sense.

Other files are automatically written by VDR, so comments don't make
much sense there.

But I have no problem with allowing comments in all files and just
dropping them when automatically writing back those files.
Is this something you'd like to have?

Klaus
  
Ville Skyttä Sept. 6, 2008, 5:22 p.m. UTC | #3
On Saturday 06 September 2008, Klaus Schmidinger wrote:
> On 09/06/08 18:38, Ville Skyttä wrote:
> >
> > Somewhat related - I'm wondering why comments are not allowed in
> > channels.conf, remote.conf, setup.conf and timers.conf?
> >
> > Or actually more generally why an option for disallowing comments in some
> > *.conf files exists in the first place :)
>
> Some files are "human written" and will not be overwritten by VDR.
> In those files comments make sense.
>
> Other files are automatically written by VDR, so comments don't make
> much sense there.
>
> But I have no problem with allowing comments in all files and just
> dropping them when automatically writing back those files.
> Is this something you'd like to have?

Yes, I think that's fine.  It'd allow distro packagers to ship those files 
with some meaningful comments in them out of the box instead of just empty 
files.  Especially channels.conf which (as far as I'm up to date with VDR's 
current behavior) still needs to be initially generated with external tools.
  

Patch

--- config.h    2008/04/19 09:19:22     2.2
+++ config.h    2008/09/06 14:06:56
@@ -122,7 +122,6 @@ 
                        esyslog("ERROR: error in %s, line %d", fileName, line);
                        delete l;
                        result = false;
-                      break;
                        }
                     }
                  }

and ignore the result values in vdr.c:

--- vdr.c       2008/09/06 11:24:21     2.2
+++ vdr.c       2008/09/06 14:08:44
@@ -559,17 +559,15 @@ 
    cThemes::SetThemesDirectory(AddDirectory(ConfigDirectory, "themes"));

    Setup.Load(AddDirectory(ConfigDirectory, "setup.conf"));
-  if (!(Sources.Load(AddDirectory(ConfigDirectory, "sources.conf"), true, true) &&
-        Diseqcs.Load(AddDirectory(ConfigDirectory, "diseqc.conf"), true, Setup.DiSEqC) &&
-        Channels.Load(AddDirectory(ConfigDirectory, "channels.conf"), false, true) &&
-        Timers.Load(AddDirectory(ConfigDirectory, "timers.conf")) &&
-        Commands.Load(AddDirectory(ConfigDirectory, "commands.conf"), true) &&
-        RecordingCommands.Load(AddDirectory(ConfigDirectory, "reccmds.conf"), true) &&
-        SVDRPhosts.Load(AddDirectory(ConfigDirectory, "svdrphosts.conf"), true) &&
-        Keys.Load(AddDirectory(ConfigDirectory, "remote.conf")) &&
-        KeyMacros.Load(AddDirectory(ConfigDirectory, "keymacros.conf"), true)
-        ))
-     EXIT(2);
+  Sources.Load(AddDirectory(ConfigDirectory, "sources.conf"), true, true);
+  Diseqcs.Load(AddDirectory(ConfigDirectory, "diseqc.conf"), true, Setup.DiSEqC);
+  Channels.Load(AddDirectory(ConfigDirectory, "channels.conf"), false, true);
+  Timers.Load(AddDirectory(ConfigDirectory, "timers.conf"));
+  Commands.Load(AddDirectory(ConfigDirectory, "commands.conf"), true);
+  RecordingCommands.Load(AddDirectory(ConfigDirectory, "reccmds.conf"), true);
+  SVDRPhosts.Load(AddDirectory(ConfigDirectory, "svdrphosts.conf"), true);
+  Keys.Load(AddDirectory(ConfigDirectory, "remote.conf"));
+  KeyMacros.Load(AddDirectory(ConfigDirectory, "keymacros.conf"), true);

    if (!*cFont::GetFontFileName(Setup.FontOsd)) {
       const char *msg = "no fonts available - OSD will not show any text!";