Re: Bug#199234: ucf: cannot handle files non-existent by default
On Mon, 14 Jul 2003 02:32:42 +0200, Martin Godisch <martin@godisch.de> said:
> On Sun, Jul 13, 2003 at 15:20:43 -0500, Manoj Srivastava wrote:
>> > In some cases a default configuration file might be
>> > "non-existent". In such a case, and when a program interprets a
>> > missing and an empty config file in different ways, there is no
>> > possibility to ucf-remove that file. A command line switch, e.g.
>>
>> > ucf --delete <Destination>
>>
>> > would be nice. I can give further explanation if necessary. Thank
>> > you!
>>
>> Please. I am quite confused at this point ;-)
> No problem, lets have an example: nullmailer has a config file
> /etc/nullmailer/defaultdomain. If that file is present then its
> content will be used to qualify email addresses, if not then
> /etc/mailname will be used instead. Especially, nullmailer will
> qualify adresses with the empty string if there is an empty
> defaultdomain file.
> Now, I want to handle this file using ucf: I'm asking in the debconf
> dialog for the value, which may be empty, and defaults to the
> special value `none', which means not to have this file at all,
> i.e. to use /etc/mailname.
So, the user has direct input as to what is to be done.
> From the debconf variable postinst creates a new package default for
> defaultdomain (into some temporary file), which may be non-existent
> if `none' was entered (or the question has been skipped because of
> its priority). Then ucf is called with that new file, which may be
> empty, or may be non-existent, where empty != non-existent, as
> described above.
If the value exists, then ucf can be used directly, so the
only interesting case is when the value is none.
> ... and (if $RET == none and there is a defaultdomain file present)
> the user should be asked some kind of:
Now, let us examine how we could have gotten into this
situation.
a) At some time in the past, the user gave a value, and this time
they were asked and changed their mind. (they have just answered
this question).
b) At some time in the past, they were asked, and said none, but
changed their mind midway and created a value.
In neither one of these cases they want to be asked again:
they have made their preference clear. Can you tell me a use case
where a question is desirable?
A complicating scenario would be if the maintainer default
changed from a value to none; or vice versa.
Additionally, I think you'll be well advised to differentiate
between none and question not asked -- so let the default value be
unknown. (The postinst can choose to treat unknown the same as none,
if you desire).
Here is a detailed analysis
old default new default file exists new debconf action
none none no none do nothing
none none no unknown do nothing
none none no value create
none none yes none move file
none none yes unknown do nothing
none none yes value change file
none value no none do nothing
none value no unknown 1 ASK*
none value no value create file
none value yes none delete file
none value yes unknown 2 UCF
none value yes value change file
value none no none do nothing
value none no unknown do nothing
value none no value create file
value none yes none delete file
value none yes unknown do nothing
if user
changed
file,
else delete
value none yes value create file
value same no none do nothing
value same no unknown do nothing
value same no value create file
value same yes none delete file
value same yes unknown do nothing
value same yes value create file
value value no none delete file
value value no unknown 3 UCF****
value value no value create file
value value yes none delete file
value value yes unknown 4 UCF*****
value value yes value create file
So, there are 4 cases where some interaction may be needed.
However, in each of these cases, the only reason we are interacting
is that the debconf question was not asked -- so if the priority of
the question was correct, then the user does not want to be bothered
by the package. I am not sure ucf is what is needed here.
The only interesting case are 1 and 2 -- and arguably, the
user should not be bothered again by ucf, since they have declined
already by ignoring the debconf question.
manoj
--
Humor in the Court: Q: The truth of the matter is that you were not an
unbiased, objective witness, isn't it. You too were shot in the
fracas? A: No, sir. I was shot midway between the fracas and the
naval.
Manoj Srivastava <srivasta@debian.org> <http://www.debian.org/%7Esrivasta/>
1024R/C7261095 print CB D9 F4 12 68 07 E4 05 CC 2D 27 12 1D F5 E8 6E
1024D/BF24424C print 4966 F272 D093 B493 410B 924B 21BA DABB BF24 424C
Reply to: