[mythtv] #10305 heads up, mysql.txt removal + config.xml changes + UPnP fixes
raymond at wagnerrp.com
Thu May 3 19:59:36 UTC 2012
On 5/3/2012 15:48, Lawrence Rust wrote:
> On Thu, 2012-05-03 at 15:21 -0400, Michael T. Dean wrote:
>> On 05/03/2012 03:02 PM, Lawrence Rust wrote:
>>> On Thu, 2012-05-03 at 11:24 -0400, Daniel Kristjansson wrote:
>>>> I've attached the latest patchset to the ticket. I just wanted to
>>>> give everyone a heads up in case they had strong opinions on the
>>>> config.xml format or want to look at the UPnP backend discovery
>>>> Summary of changes:
>>>> * Format of config.xml
>>>> + Database settings have their own top-level instead of being under
>>>> + Wake On Lan settings have been added to config.xml, these
>>>> were formerly only settable using mysql.txt.
>>> The parsing of xml files is just a total waste of CPU resources. They
>>> add no useful information c.f. a well constructed ini file,
>> FWIW, I think any machine that can handle running MythTV (or even
>> scripts that use MythTV) can handle parsing a 500B XML file. Yes, I
>> realize that's nearly a half kilobyte, but still... ;)
> Why do we bother to optimize our code then? There's always more RAM and
> a faster CPU...
>>>> * mysql.txt reading has been removed. This does not port over
>>>> Wake On Lan settings and all other settings not written to the
>>>> file by default are ignored.
>>> There are many 3rd party scripts that rely on mysql.txt. It can contain
>>> the same information as config.xml and takes just a fraction of the CPU
>>> resources to parse. Why not settle for this file alone? Or, what about
>>> a halfway house - a config utility that takes simple command line
>>> queries and returns simple text strings.
>> The bindings--both Perl and Python (and PHP?)--use only config.xml and
>> ignore mysql.txt. When it was added (long ago), the decision was made
>> that it would be used for all future stuff, but we just haven't gotten
>> around to actually removing the mysql.txt stuff until now.
> php doesn't have(need) specific Myth bindings. It can, and does, use
> both file formats.
Although technically they don't read either form of file, and need to be
told where to go.
>> Whichever file we use, we need only one. I really don't see any reason
>> why mysql.txt is better than config.xml--it will never contain a lot of
>> information, so...
> Why break so many things when there's no need. It's so easy to 'knock
> up' a mysql.txt for a specific occasion.
The existing mysql.txt is only of value for people writing scripts in
bash, as it can just be directly sourced without any kind of parsing.
The only value it has for use in bash is when trying to access the
database directly, and if you need to access the database directly, you
can spend the effort writing whatever you're doing in a "proper"
programming language with native MySQL bindings and proper type
handling, rather than something that is just going to clumsily wrap the
`mysql` shell client. Any such language is going to have some form of
XML parser available, and not have any problem dealing with the config.xml.
More information about the mythtv-dev