Bug#774073: dh-make-perl: Ceating core module, install fails with "trying to overwrite foo which is also in bar"

Andrew Beverley andy at andybev.com
Sun Dec 28 15:57:22 UTC 2014


On Sun, 2014-12-28 at 14:51 +0200, Niko Tyni wrote:
> On Sun, Dec 28, 2014 at 12:19:32PM +0000, Andy Beverley wrote:
> > Package: dh-make-perl
> > Version: 0.75-1
> > Severity: normal
> > Tags: upstream patch
> 
> > When creating an updated version of a module that is already in core,
> > the subsequent install fails (as expected) with a message such as:
> > "trying to overwrite '/usr/bin/instmodsh', which is also in package
> > perl 5.14.2-21+deb7u2".
> > 
> > Given that dh-make-perl has to be forced into creating core modules,
> > I think it's appropriate to instruct dpkg that the package contains
> > files that replace the core module. This patch does so.
> 
> Please note that a "Replaces" entry isn't quite enough for packages with
> conflicting files to coexist cleanly: in case the replacing package
> gets removed later, the conflicting file would then be gone from the
> system altogether.

Good point, I hadn't thought of that.

> A more robust solution is using dpkg-divert in maintainer scripts to move
> the core version out of the way and then back later if necessary. See
> for instance the libmodule-corelist-perl package for an example
> implementation.

Thanks for the example. I'm currently thinking of this as a solution,
but wondering whether there is an easier way?

1. Check if the module is provided by core
2. If so, check which files in the new package are already in core
3. For each of those files, generate a dpkg-divert line

In the case of a large module, there could be several dozen dpkg-divert
lines, but I can't see a better way of doing it?

Thanks,

Andy



More information about the pkg-perl-maintainers mailing list