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

Correct method for aborting package installation from maintainer scripts



I have a library package, X, for which the latest version cannot read files
written by older versions (this is beta software).  I would like, when a user
upgrades from the old version of X to the new version, for them to receive a
warning (via debconf), and be given the chance to abort the upgrade.  This
is easy enough to do for X, using a Pre-Depends on debconf and a check in
preinst.

However, there exists a package Y, which depends on the library X.  It, too,
has the problem of not being able to read older files if X is upgraded.  Y has
the same upstream source as X, and they must be the same version in order to
work.

My question is, how can I prevent the user from breaking their installation of
Y?  If X and Y are being upgraded in the same dpkg invocation, Y could be
unpacked before X.  Although X's preinst could abort and prevent it from being
unpacked, Y would already be unpacked (and unable to configure due to a
versioned dependency on X).

What is the best practice in this situation?  In the case where apt and
preconfiguration are being used, I could have the config script abort.  Is that
my only option?  What about users who don't use apt, or don't use
preconfiguration?

-- 
 - mdz



Reply to: