Re: Policy, updmap --enable and updmap.cfg in /etc or /var
Florent Rougon <f.rougon@free.fr> wrote:
> Hi,
>
> Frank Küster <frank@debian.org> wrote:
>
>> I do not see why it is necessary to know that. Why not do something like
>> the following in postinst:
>>
>> if [ ! -f $CONFIG_FILE ]; then
>> # the config file does not exist (i.e. not simply an upgrade).
>
> That does not follow: if the admin deletes $CONFIG_FILE (which is
> perfectly OK if he doesn't want lmodern in his map files but wants the
> package to remain installed), then makes a simple upgrade, $CONFIG_FILE
> is *not* present neither before, nor during, nor after the upgrade.
>
>> if [ -f $TEMP_CONFIG_FILE ]; then
>
> Are you sure you meant $TEMP_CONFIG_FILE?
No, I meant the backup file in /var/lib/{lmodern/texmaps/whatever}.
> I'm snipping the rest of you script because I don't see it working
> (starting from the $TEMP_CONFIG_FILE), or maybe don't understand it.
It should of course start from $SAVED_CONFIG_FILE.
> If you want to do the initial setup of the config file for fresh
> installations (from the 'purged' state) in postinst, you have a problem
> because you'll want to do it in the situation 2 above, but you have no
> way to tell that this is not a simple upgrade with $CONFIG_FILE deleted
> by the admin. That is why I decided to create the default config file in
> preinst.
Yes, I was wrong.
> There might be a way where we would drop some "flag" file in $STATE_DIR
> on fresh installs from the preinst script, and then check in postinst
> whether that file exists, and if so, copy the default config file from
> /usr/share/$package to $CONFIG_FILE (and then delete the "flag" file).
> I'd have to check a bit more whether it's really safe, but I'm not sure
> it is worth it: it is really simpler?
No, I think it isn't worth it.
Regards, Frank
--
Frank Küster
Inst. f. Biochemie der Univ. Zürich
Debian Developer
Reply to: