On 7 Dec 2005 at 8:12, Fabio Tranchitella wrote:
>   in my opinion the reconfigure target of dpkg can't delete a
> configuration file that could be modified by the system administrator,
> so I prefer to not implement such a feature.
I'm on your side here (I wrote, I do not know, if deleting is a good idea), but 
I think, it 
should be possible to reconfigure with dpkg-reconfigure, if the package was 
configured 
by debconf during installation. Is deleting config.php really the only way to 
achieve this?

I tweaked /var/lib/dpkg/info/phpldapadmin.config just a little bit and modified 
line 9:

--- line 9 ---
if [ ! -f $CONFFILE ] || [ $(md5sum $CONFFILE | awk '{print $1}') = 
"43b124661b7e30fb94c37c3c221124eb" ] || [ "$1" = "reconfigure" ]; then
--- line9 ---

Then of course you have to modify /var/lib/dpkg/info/phpldapadmin.postinst a 
little bit. I 
removed line 25 (exit 0), because otherwise this script would just do nothing.

For me this is working. Ok, I do not know what happens, if someone tweaked 
config.php heavily, but this guy what not use dpkg-reconfigure, wouldn't he? 
And if 
heavy tweaking would make problems, then a warning message at the beginning of 
debconf dialog would be appropriate.

I'm not quite sure about the second argument of the if clause. Where does the 
given 
md5sum come from and why are you checking this? $CONFFILE 
(/etc/phpldapadmin/config.php) should always have a different md5sum, if some 
user 
defined parameters are set and the md5sum of 
/usr/share/phpldapadmin/config.php.example is on my PC 
829da044d6c402ca3db35bf9b70e5ac6  . Can you help me with this?

> > Perhaps the mentioned files should be deleted by
> > /var/lib/dpkg/info/phpldapadmin.config, when it is called with the
> > reconfigure argument, but I do not know, if this is a good idea,
> > since I'm a noob in this area.
> 
> If you agree (and think it would be useful), I could add a note about
> this behaviour (delete the config file to be asked again by debconf
> while reconfiguring) in README.Debian.
> 
> I assume this would be enough.

Well, I described another possible solution above. Honestly, I'm not a 
programmer and I 
never configured debconf files before, so I'm not sure, if it is a good 
solution or if it could 
brake something. But I think, that a simple dpkg-reconfigure should be enough 
without 
deleting first some files. In my opinion, a note in README.Debian should be the 
last 
option to solve this behaviour, if everything else fails.

Regards,
Marc Blumentritt




-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to