[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Interaktive questions in "postrm purge" allowed?



On 2004-06-06 Christian Hammers <ch@debian.org> wrote:
> I have a database package that wants to know if it should really also remove
> the databases themselves when purging the package (just because they are much
> more important than config files etc).

> Until now I did this via debconf but a user suggested to do it in postrm
> because when installing the database one can hardly know what one wants month
> later when removing the package...

> So is it ok to ask interactive questions in postrm when called with "purge"?
> As the script is not called with purge in a normal apt-get upgrade run I can
> see no problems, do you?

Yes, asking on postrm purge is ok. However of course you should
continue using debconf instead of some handwritten parsing to ask
the question.

I'll just quote the wonderfgul documentation debconf-devel(7) instead
of wasting my time:

| A more involved use of debconf would be if you want to use it in
| the postrm when your package is purged, to ask a question about
| deleting something. Or maybe you find you need to use it in the
| preinst or prerm for some reason. All of these uses will work,
| though they’ll probably involve asking questions and acting on
| the answers in the same program, rather than separating the two
| activities as is done in the config and postinst scripts.
| 
| Note that if your package’s sole use of debconf is in the
| postrm, you should make your package’s postinst sources
| /usr/share/debconf/confmod‐ ule, to give debconf a chance to load
| up your templates file into its database. Then the templates will
| be available when your package is being purged.

              cu andreas
-- 
"See, I told you they'd listen to Reason," [SPOILER] Svfurlr fnlf,
fuhggvat qbja gur juveyvat tha.
Neal Stephenson in "Snow Crash"



Reply to: