Re: Checking if another package is upgraded at the same time
On Thu, Mar 23, 2006 at 12:11:59AM +0200, Kari Pahula wrote:
> I'm maintaining two interrelated packages, crossfire-server and
> crossfire-maps. The former depends on the latter. It is possible to
> upgrade them separately, but upgrading the maps alone leads to
> problems. The server runs as a daemon and will be more or less at an
> inconsistent state if the maps are upgraded while it is running.
So you want to have a one-way dependency (since you can have -maps
installed without "causing problems"). -server should depend on
-maps, perhaps (>=X-1), (<<[X+1]-1). The trailing -1 is the debian
version, not a subtraction, but the [X+1] is subtraction:
Depends: crossfire-maps (>=0.95.3), crossfire-maps (<<0.96)
This assumes that the 3rd version component is for bugfixes, and
doesn't break compatibility.
> Restarting the server needs to be done when upgrading crossfire-maps.
> But having one package to automatically cause another to run
> /etc/init.d/foo restart is certain to surprise a number of users.
> Using debconf to ask whether to abort install, install and restart or
> just install sounds like a good idea to me.
Overuse of debconf is discouraged; check the dict-bouvier and
gazetterer packages for examples one one package restarting another
Note that policy 188.8.131.52 "strongly recommends" using invoke-rc.d (when
available) rather than running the init scripts directly.
> But doing this leads to another slight problem when upgrading
> crossfire-server and crossfire-maps at the same time. Namely, the
> question in crossfire-maps is unnecessary in this case since upgrading
> crossfire-server will restart the server anyway. So I'd like to have
> crossfire-maps to simply go ahead and install the files if the server
> is upgraded on the same run. Is there any reliable way to check if
> the server is being upgraded in crossfire-maps' preinst?
I think this is probably one of the questions that is indicitive of
doing stuff the wrong way :)