Re: dpkg: overwriting file from other package fails despite diversion

2012-11-21 Thread gator_ml
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



dpkg: overwriting file from other package fails despite diversion

2012-11-19 Thread gator_ml
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