Bug#1408: xfig always asks about colour/mono
D. J. Gregor writes ("Re: Bug#1408: xfig always asks about colour/mono "):
> I need a few clarifications of things. I have been very busy
> lately with my workload at school, and I have not been able to keep up.
> First, the postinst in my Xfig package checks for the existence
> of the Xfig app-defaults file, and if it exists, it does not ask you if
> you want color or mono. Secondly, the postrm removes the Xfig link.
> Now, my question is - does dpkg run a "remove" and then an
> "install" again when it is updating packages? That would explain why
> you are getting asked more than once.
dpkg runs the postrm script, yes. See
project/standards/maintainer-script-args.txt (this may still be in
Incoming). You can tell from the arguments to the maintainer script
whether the package is being removed or upgraded.
In any case, you shouldn't remove the link unless the package's
configuration files are purged (dpkg --purge, postrm script called
> (BTW - the version of dpkg that I
> am using does not do this...)
Wibble. What version are you running ? I believe all versions since
around 0.93.10 (November 1994) do.
> Also, the app-defaults file is simply that - an application
> _default_. It is meant to be there in case there are no other
> resources for that application. I am sorry to be hard-headed, and
> it is probably caused by my not being up to date on things, but I
> think that the current means of dealing with color or monochrome
> support for the app-defaults in fine. I will change it if there is
> a good reason to do so. (again, I am not up to date, so I do not know
> of any good alternatives). If you could give me a little explanation
> of one or two ways to do it, or point me to some documentation, I will
> be happy to consider it.
I'm suggesting you arrange for
/usr/..../app-defaults/Xfig -> /etc/X11/xfig-appdefaults
in the package.
Then, the postinst arranges for
/etc/X11/xfig-appdefaults -> /usr/.../app-defaults/Xfig.colour
(with a prompt) if it doesn't find one already, and this link is only
removed during postrm purge.