<div dir="ltr"><div>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:</div><div><br></div><div><div>Setting up company-it-profile-pidgin (20171218) ...</div><div>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'</div><div>dpkg: error processing package company-it-profile-pidgin (--configure):</div><div>Â subprocess installed post-installation script returned error exit status 2</div><div>Setting up company-it-profile-vpn-profiles (20171218) ...</div><div>Setting up company-it-profile (20171218) ...</div><div>Removing 'diversion of /etc/purple/prefs.xml to /etc/purple/prefs.xml.company-orig by company-it-profile'</div><div>Errors were encountered while processing:</div><div>Â company-it-profile-pidgin</div><div>E: Sub-process /usr/bin/dpkg returned an error code (1)</div></div><div><br></div><div>As mentioned it appears that prerm script is not removing the divert on upgrade.</div><div><br></div><div>Thanks,</div><div>Nick</div><div>Â </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>in my case, a few diverted files have been removed from one package and<br>added to a new package.<br>In the existing packages, the displaced files and the .displace have<br>been removed.<br>The problem seems, the prerm script will only do undisplace_unlink on<br>remove and deconfigure. Not on upgrade. Therefore the dpkg diversions<br>will not be removed and conflict with the new package.<br>Wouldn't it be better to always do undisplace_unlink in the prerm script<br>and to redo what is necessary in the postinst script? I think that would<br>handle the upgrade case better where displaced files are no longer<br>necessary.<br>Cheers,<br>Patrick<br>Lukas Anzinger:<br>> Hi,<br>>Â <br>> while I haven't tried it, I think it would be sufficient to just move<br>> the *.displace file from the old source package to the new one.<br>> Additionally you will need a versioned conflict and replace, see also<br>> <a href="https://wiki.debian.org/Renaming_a_Package" target="_blank">https://wiki.debian.org/<wbr>Renaming_a_Package</a>. The postrm script of the<br>> old package cleans up the symlink during upgrades before the new<br>> packages creates the new one. The conffiles are left alone by<br>> config-package-dev and handled solely by dpkg.<br>>Â <br>> Regards,<br>>Â <br>> Lukas<br>>Â <br>> On Mon, Jan 27, 2014 at 5:44 PM, Patrick Schleizer <adrelanos at <a href="http://riseup.net" target="_blank">riseup.net</a>> wrote:<br>>> Hi,<br>>><br>>> let's say you have a few displaced files in package "a", which is<br>>> already installed. Now you plan to upgrade package "a" and to move the<br>>> displaced files to package "b". While package "a" depends on/or<br>>> recommends package "b".<br>>><br>>> Are such cases supported or could any maintainer scripts have clashing<br>>> dpkg-diversions or issues like that?<br>>><br>>> Cheers,<br>>> Patrick<br>>> ______________________________<wbr>_________________<br>>> config-package-dev mailing list<br>>> config-package-dev at <a href="http://mit.edu" target="_blank">mit.edu<br></a>>> <a href="http://mailman.mit.edu/mailman/listinfo/config-package-dev" target="_blank">http://mailman.mit.edu/<wbr>mailman/listinfo/config-<wbr>package-dev<br></a>> Hi,<br>in my case, a few diverted files have been removed from one package and<br>added to a new package.<br>In the existing packages, the displaced files and the .displace have<br>been removed.<br>The problem seems, the prerm script will only do undisplace_unlink on<br>remove and deconfigure. Not on upgrade. Therefore the dpkg diversions<br>will not be removed and conflict with the new package.<br>Wouldn't it be better to always do undisplace_unlink in the prerm script<br>and to redo what is necessary in the postinst script? I think that would<br>handle the upgrade case better where displaced files are no longer<br>necessary.<br>Cheers,<br>Patrick<br>Lukas Anzinger:<br>> Hi,<br>>Â <br>> while I haven't tried it, I think it would be sufficient to just move<br>> the *.displace file from the old source package to the new one.<br>> Additionally you will need a versioned conflict and replace, see also<br>> <a href="https://wiki.debian.org/Renaming_a_Package" target="_blank">https://wiki.debian.org/<wbr>Renaming_a_Package</a>. The postrm script of the<br>> old package cleans up the symlink during upgrades before the new<br>> packages creates the new one. The conffiles are left alone by<br>> config-package-dev and handled solely by dpkg.<br>>Â <br>> Regards,<br>>Â <br>> Lukas<br>>Â <br>> On Mon, Jan 27, 2014 at 5:44 PM, Patrick Schleizer <adrelanos at <a href="http://riseup.net" target="_blank">riseup.net</a>> wrote:<br>>> Hi,<br>>><br>>> let's say you have a few displaced files in package "a", which is<br>>> already installed. Now you plan to upgrade package "a" and to move the<br>>> displaced files to package "b". While package "a" depends on/or<br>>> recommends package "b".<br>>><br>>> Are such cases supported or could any maintainer scripts have clashing<br>>> dpkg-diversions or issues like that?<br>>><br>>> Cheers,<br>>> Patrick<br>>> ______________________________<wbr>_________________<br>>> config-package-dev mailing list<br>>> config-package-dev at <a href="http://mit.edu" target="_blank">mit.edu<br></a>>> <a href="http://mailman.mit.edu/mailman/listinfo/config-package-dev" target="_blank">http://mailman.mit.edu/<wbr>mailman/listinfo/config-<wbr>package-dev<br></a>>Â </blockquote></div>