[config-package-dev] migration of diverted files from one package to another?

Nicholas Brown nickbroon at gmail.com
Wed Dec 20 09:42:05 EST 2017


I'm also bumping into this issue. I simply cannot split an existing package
A that contains a displace, into packages A and B (A now recommending B)
with B now containing the displace, as it always complains about the
diverts clashing. On upgrade A I get this error:

Setting up company-it-profile-pidgin (20171218) ...
dpkg-divert: error: 'diversion of /etc/purple/prefs.xml to
/etc/purple/prefs.xml.company-it-profile-pidgin-orig by
company-it-profile-pidgin' clashes with 'diversion of /etc/purple/prefs.xml
to /etc/purple/prefs.xml.company-orig by company-it-profile'
dpkg: error processing package company-it-profile-pidgin (--configure):
 subprocess installed post-installation script returned error exit status 2
Setting up company-it-profile-vpn-profiles (20171218) ...
Setting up company-it-profile (20171218) ...
Removing 'diversion of /etc/purple/prefs.xml to
/etc/purple/prefs.xml.company-orig by company-it-profile'
Errors were encountered while processing:
 company-it-profile-pidgin
E: Sub-process /usr/bin/dpkg returned an error code (1)

As mentioned it appears that prerm script is not removing the divert on
upgrade.

Thanks,
Nick


> Hi,
> in my case, a few diverted files have been removed from one package and
> added to a new package.
> In the existing packages, the displaced files and the .displace have
> been removed.
> The problem seems, the prerm script will only do undisplace_unlink on
> remove and deconfigure. Not on upgrade. Therefore the dpkg diversions
> will not be removed and conflict with the new package.
> Wouldn't it be better to always do undisplace_unlink in the prerm script
> and to redo what is necessary in the postinst script? I think that would
> handle the upgrade case better where displaced files are no longer
> necessary.
> Cheers,
> Patrick
> Lukas Anzinger:
> > Hi,
> >
> > while I haven't tried it, I think it would be sufficient to just move
> > the *.displace file from the old source package to the new one.
> > Additionally you will need a versioned conflict and replace, see also
> > https://wiki.debian.org/Renaming_a_Package. The postrm script of the
> > old package cleans up the symlink during upgrades before the new
> > packages creates the new one. The conffiles are left alone by
> > config-package-dev and handled solely by dpkg.
> >
> > Regards,
> >
> > Lukas
> >
> > On Mon, Jan 27, 2014 at 5:44 PM, Patrick Schleizer <adrelanos at
> riseup.net> wrote:
> >> Hi,
> >>
> >> let's say you have a few displaced files in package "a", which is
> >> already installed. Now you plan to upgrade package "a" and to move the
> >> displaced files to package "b". While package "a" depends on/or
> >> recommends package "b".
> >>
> >> Are such cases supported or could any maintainer scripts have clashing
> >> dpkg-diversions or issues like that?
> >>
> >> Cheers,
> >> Patrick
> >> _______________________________________________
> >> config-package-dev mailing list
> >> config-package-dev at mit.edu
> >> http://mailman.mit.edu/mailman/listinfo/config-package-dev
> > Hi,
> in my case, a few diverted files have been removed from one package and
> added to a new package.
> In the existing packages, the displaced files and the .displace have
> been removed.
> The problem seems, the prerm script will only do undisplace_unlink on
> remove and deconfigure. Not on upgrade. Therefore the dpkg diversions
> will not be removed and conflict with the new package.
> Wouldn't it be better to always do undisplace_unlink in the prerm script
> and to redo what is necessary in the postinst script? I think that would
> handle the upgrade case better where displaced files are no longer
> necessary.
> Cheers,
> Patrick
> Lukas Anzinger:
> > Hi,
> >
> > while I haven't tried it, I think it would be sufficient to just move
> > the *.displace file from the old source package to the new one.
> > Additionally you will need a versioned conflict and replace, see also
> > https://wiki.debian.org/Renaming_a_Package. The postrm script of the
> > old package cleans up the symlink during upgrades before the new
> > packages creates the new one. The conffiles are left alone by
> > config-package-dev and handled solely by dpkg.
> >
> > Regards,
> >
> > Lukas
> >
> > On Mon, Jan 27, 2014 at 5:44 PM, Patrick Schleizer <adrelanos at
> riseup.net> wrote:
> >> Hi,
> >>
> >> let's say you have a few displaced files in package "a", which is
> >> already installed. Now you plan to upgrade package "a" and to move the
> >> displaced files to package "b". While package "a" depends on/or
> >> recommends package "b".
> >>
> >> Are such cases supported or could any maintainer scripts have clashing
> >> dpkg-diversions or issues like that?
> >>
> >> Cheers,
> >> Patrick
> >> _______________________________________________
> >> config-package-dev mailing list
> >> config-package-dev at mit.edu
> >> http://mailman.mit.edu/mailman/listinfo/config-package-dev
> >
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/config-package-dev/attachments/20171220/3ed370c7/attachment.html


More information about the config-package-dev mailing list