Re: dpkg: overwriting file from other package fails despite diversion
On 2012-11-20 20:08, Sven Joachim wrote: On 2012-11-19 10:17 +0100, gator...@yahoo.de wrote: In order to be able to overwrite foreign files without triggering a conflict, I install diversions for the files in question. As described in the policy manual (http://www.debian.org/doc/debian-policy/ap-pkg-diversions.html) I used ad preinst script with something like this: dpkg-divert --package $our_package --add --rename \ --divert ${dest_name}.org ${dest_name} As intended, the original file versions are renamed before the actual installation. Nevertheless, dpkg complains about a conflict and aborts. After I made a minimal test package (which worked as expected on all systems i tried) I eventually found the problem: My package name contained a hyphen (-), but in the preinst script I had used an underscore (_) instead, so the diversion was created (almost) as intended, only for the wrong package ... ;-) Was there any recent change compared to the policy manual? (I am doing this on wheezy). Did I get something wrong? To my understanding, this is pretty exactly the scenario, that is described in the manual ... Also the one used by various Debian packages, so it can be assumed to work in general, or there would have been bug reports. just out of curiosity: do you know any examples for this in wheezy? I had tried to find some, but all I could come up with were historic - in contemporary packages the preferred method seems to be via alternatives ... Regards, Peter -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/k8i9pg$v2s$1...@ger.gmane.org
Re: dpkg: overwriting file from other package fails despite diversion
On 2012-11-21 11:18 +0100, gator...@yahoo.de wrote: After I made a minimal test package (which worked as expected on all systems i tried) I eventually found the problem: My package name contained a hyphen (-), but in the preinst script I had used an underscore (_) instead, so the diversion was created (almost) as intended, only for the wrong package ... ;-) Such PEBKAC happens to all of us once in a while, I guess. Was there any recent change compared to the policy manual? (I am doing this on wheezy). Did I get something wrong? To my understanding, this is pretty exactly the scenario, that is described in the manual ... Also the one used by various Debian packages, so it can be assumed to work in general, or there would have been bug reports. just out of curiosity: do you know any examples for this in wheezy? Here's a list for my system: , | $ LANG=C dpkg-divert --list | grep -v ^local | sed 's/.* by //' | sort -u | dash | dictionaries-common | gnupg-curl | iceweasel | libdigest-sha-perl | libgtk-3-bin | perl-doc | vim-runtime ` I had tried to find some, but all I could come up with were historic - in contemporary packages the preferred method seems to be via alternatives ... One downside with diversions is that it is only possible to divert a file once, whereas there can be many alternatives. However, switching from diversions to alternatives requires coordination between packages, and for essential files like /bin/sh the alternatives system is probably not quite robust enough. Cheers, Sven -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/87wqxerixb@turtle.gmx.de
Re: dpkg: overwriting file from other package fails despite diversion
On 2012-11-19 10:17 +0100, gator...@yahoo.de wrote: For a pretty complex system modification I need to replace binaries from several other packages by modified versions. Because I'll need to easily reproduce these modifications and would like to keep things as transparent as possible, I wrapped the necessary changes into a Debian package (I don't want to maintain modified versions of all the affected packages). In order to be able to overwrite foreign files without triggering a conflict, I install diversions for the files in question. As described in the policy manual (http://www.debian.org/doc/debian-policy/ap-pkg-diversions.html) I used ad preinst script with something like this: dpkg-divert --package $our_package --add --rename \ --divert ${dest_name}.org ${dest_name} As intended, the original file versions are renamed before the actual installation. Nevertheless, dpkg complains about a conflict and aborts. What are the exact error messages? It might also be useful to invoke dpkg with the -D110 option to debug the problem. Was there any recent change compared to the policy manual? (I am doing this on wheezy). Did I get something wrong? To my understanding, this is pretty exactly the scenario, that is described in the manual ... Also the one used by various Debian packages, so it can be assumed to work in general, or there would have been bug reports. Cheers, Sven -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/87ehjo5by7@turtle.gmx.de
dpkg: overwriting file from other package fails despite diversion
For a pretty complex system modification I need to replace binaries from several other packages by modified versions. Because I'll need to easily reproduce these modifications and would like to keep things as transparent as possible, I wrapped the necessary changes into a Debian package (I don't want to maintain modified versions of all the affected packages). In order to be able to overwrite foreign files without triggering a conflict, I install diversions for the files in question. As described in the policy manual (http://www.debian.org/doc/debian-policy/ap-pkg-diversions.html) I used ad preinst script with something like this: dpkg-divert --package $our_package --add --rename \ --divert ${dest_name}.org ${dest_name} As intended, the original file versions are renamed before the actual installation. Nevertheless, dpkg complains about a conflict and aborts. For the moment, I work around the problem by renaming my versions of the affected files so they can be installed without a conflict. I still install the diversions as described above and in a postinst script create symlinks with the original file names pointing to my modified binaries. This works, but is not as transparent as I would like - I would prefer to directly overwrite the diverted files as described in the policy manual. Was there any recent change compared to the policy manual? (I am doing this on wheezy). Did I get something wrong? To my understanding, this is pretty exactly the scenario, that is described in the manual ... Any ideas? Peter -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/k8ctf7$lq1$1...@ger.gmane.org