On Fri, 2008-05-16 at 13:16 -0700, Adam Williamson wrote:
> Hi, all. I only just signed up for the list but most of you probably
> know me from IRC, I'm the guy packaging synce for Mandriva.
> 
> I realized today that synce's handling of its configuration file is
> pretty bad. Quick overview of how it's handled at present:
> 
> synce installs a default configuration file to /usr somewhere. This copy
> of the file is never actually used in operation. It's just used for the
> next bit...
> 
> When you run sync-engine, it checks if ~/.synce/config.xml exists. If it
> doesn't, it copies the default configuration file from /usr to
> ~/.synce/config.xml .
> 
> The default file is 'active' - that is, it actually sets all the values
> it contains, they're not commented out by default.

Comment them out if you wish - sync-engine will work with the same
defaults. It has to pick up runtime values from somewhere. If config.xml
is not present, it will use its own internal defaults (which are the
same as the values contained in the config file).

> 
> This is fairly crack-addled in many ways. Easy to illustrate with a
> single value from the file: 

Thank you. Just for the record I do not, and never have, used crack.

I agree that leaving the defaults uncommented in the XML is probably not
a good idea from the point of view of user upgrades. I'll change this in
the SVN tree tonight. It's a simple change, all that is needed is to
comment out the defaults.

> Everyone who's already using
> synce will have a ~/.synce/config.xml . We can't make synce's
> installation routine edit that file, that'd just be horrible. So anyone
> who's already used synce is basically stuck with all the default
> configuration values that happened to exist whenever they first
> installed synce. Forever. 

Err, no. Not forever. This file is read at _runtime_. Nothing is preventing
a user, (or any other program for that matter) from editing that file. That
is why I used XML for the format - many programs can sensibly handle this
format.

> Even if those defaults stop making sense in
> future. Even if they never actively set any of those values.
> 
> This is how it should be done:
> 
> The default config file should install in /etc somewhere, and if it
> exists, sync-engine should take it into account when running. It should
> *not* actually be 'active' by default: it should list all the default
> settings, but they should be commented out. All the defaults should be
> written into synce itself.
 
The defaults _are_ in sync-engine itself.

> 
> Whether we create ~/.synce/config.xml by default or not is essentially a
> moot point. We may as well, because it aids discoverability, but even if
> we don't, everything would work. (As a corollary, sync-engine should not
> fail to run if no user configuration file exists and it can't copy the

It should not fail to run. Sync-engine will run just fine using sensible
defaults without requiring a ~/.synce/config.xml. I do not know what the
packages do, but the development tree copies the file from a location in
the tree itself, so it should be guaranteed to be there as part of the
install. If the packages do it in a fashion where it can break, this needs
to be addressed.

However, I fully appreciate the value of leaving the defaults commented
out in the XML, and this will be done shortly.

> original from /usr for some reason 

Only if the install is broken.

> - that's just crack. It should go

> ahead and run, but print a warning). If we do, it should obviously be
> the same as the copy in /etc : it should not actually set any values at
> all by default.
> 

If it fails, it is because the sync-engine install is broken. That file
should be there as part of a complete sync-engine install.

> This would work far better. Now if we want to change a default value in
> a new version of synce, it's no problem: just change it in synce's code,

That is exactly what happens at the moment - but I agree that the
defaults shoudl be commented out in the XML.

> 
> It's also far better for distribution packagers, like me. The current

I can see this to be true.

> Thanks for reading, hope this can be changed soon :)

I'll put it in SVN tonight (don't know how long it will take to reach
the packages.

        John.



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
SynCE-Devel mailing list
SynCE-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synce-devel

Reply via email to