[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

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

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
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?

Reply to: