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

How to gracefully rename a package?



Moi!

The new version of the OpenDX toolkit now provides sane libraries, so I
wanted to restructure the packages a bit. In particular, there is a new
package libdx4, so I wanted to rename what used to be dx-dev package as
libdx4-dev. This turned out to be harder than I thought.

The -dev package will usually be used for compiling local modules, so
nothing within Debian depends on it. dx-dev's dependency on the main dx
package is versioned with (= ${Source-Version}), so when trying to
upgrade, apt wants to remove it without even considering to replace it
with the new libdx4-dev (which conflicts, provides, and replaces
dx-dev). So I created a dummy dx-dev package that simply depends on
libdx4-dev. Works fine. But I also wanted to be nice to the user and
automatically remove the dummy dx-dev once it's no longer needed.
Therefore, libdx4-dev replaces anything in dx-dev, and dpkg removes the
package. Works fine as well. Now the final problem is libdx4-dev and
dx-dev are getting upgraded at the same time, and dpkg tries to setup
dx-dev when it already has been removed:

 Preparing to replace dx-dev 1:4.2.0-8 (using dx-dev_4.3.0-1_all.deb) ...
 Unpacking replacement dx-dev ...
 Selecting previously deselected package libdx4-dev.
 Unpacking libdx4-dev (from libdx4-dev_4.3.0-1_i386.deb) ...
 Replacing files in old package dx-dev ...
 (Noting disappearance of dx-dev, which has been completely replaced.)
 dpkg: error processing dx-dev (--install):
  no package named `dx-dev' is installed, cannot configure

  Setting up libdx4-dev (4.3.0-1) ...

  Errors were encountered while processing:
   dx-dev
  
The error can simply be ignored, but it's ugly, and I'd like to avoid
it. So am I trying to do something stupid? Is there a better way to do
it? Or should I simply go file a bug on dpkg?

Any hints welcome,

Daniel.



Reply to: