[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: NEW: kconf_update, a framework for updating configuration files.
From:       Frerich Raabe <frerichraabe () gmx ! de>
Date:       2001-04-19 5:31:42
[Download RAW message or body]

On Wednesday 18 April 2001 20:29, Waldo Bastian wrote:
> How it works
> ============
>
> Applications can install so called "update files" under
> $KDEDIR/share/apps/kconf_update. An update file has ".upd" as extension and
> contains instructions for transferring/converting configuration information
>
> >from one place to another.
Sheesh, still that bug? :-}

> Updating the configuration happens automatically, either when KDE gets
> started or when kded detects a new update file in the above mentionmed
> location.
>
> Update files are seperated into sections. Each section has an Id. When a
> section describing a configuration change has been applied, the Id will be
> stored in the file "kconf_updaterc". This information is used to make sure
> that a configuration update is only performed once.
>
> If you overwrite an existing update file with a new version that contains a
> new section, only the update instructions from this extra section will be
> performed.
>
> Example update file
> ===================
>
> # This is comment
> Id=kde2.2
> File=kioslaverc,kio_httprc
> Group=Proxy Settings
> Key=NoProxyFor
> Key=UseProxy
> Key=httpProxy,Proxy
> Group=Cache Settings,Cache
> Key=MaxCacheSize
> Key=UseCache
> Group=UserAgent
> AllKeys
> # End of file
>
>
> The above update file extracts config information from the file
> "kioslaverc" and stores it into the file "kio_httprc".
>
> It reads the keys "NoProxyFor", "UseProxy" and "httpProxy" from the group
> "Proxy Settings" in the "kioslaverc" file. If any of these options are
> present they are written to the keys "NoProxyFor", "UseProxy" and "Proxy"
> (!) in the group "Proxy Settings" in the "kio_httprc" file.
>
> It also reads the keys "MaxCacheSize" and "UseCache" from the group
> "Cache Settings" in the "kioslaverc" file and writes this information to
> the keys "MaxCacheSize" and "UseCache" in the group "Cache" (!) in the
> "kio_httprc" file.
>
> Finally it takes all keys in the "UserAgent" group of the file "kioslaverc"
> and moves then to the "UserAgent" group in the "kio_httprc" file.

That's definately cool stuff, but unfortunately not flexible enough for me 
(read: KNewsTicker ;). KNewsTicker v0.1 arranged the news sources in config 
groups called '[News source #x]', x being a unique ID number. KNewsTicker 
v0.2 uses the name of a news source for the group name, thereby storing the 
news sources in a group like '[Slashdot]'.
I guess a delta algorithm which can handle such transformations, mapping the 
old entries to the new ones, of config files is quite a challange. :-}

- Frerich (who goes and writes a config converter for KDE 2.2)

-- 
int m,u,e=0;float l,_,I;main() {for(;e<1863; putchar((++e>924&&952>
e?60-m:u) ["\n .:ed.xmg@ebaarhcirerf:.   ]"])) for(u=_=l=0;(m=e%81)
<80&&I*l+_*_ <6&&25>++u;_=2*l*_+e/81*.09-1,l=I)I=l*l-_*_-2+.035*m;}

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic