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

Re: Effect of Replaces in coexisting packages



Frank Küster <frank@debian.org> writes:

> Dear dpkg team,
>
> we were talking about a framework to allow users to create font packages
> for commercial or "free-beer" fonts, and it turned out that in some
> cases these packages would provide files that are already in a Debian
> package, using a Replaces: in the control file. 
>
> Ralf Stubner <ralf.stubner@physik.uni-erlangen.de> wrote:
>
>>> No, it would replace FILES from texlive-fontsrecommended.
>>
>> <KLATSCH>, thanks for setting me straight. BTW, would that be needed in
>> both packages? I mean, one can't be sure which one is installed first
>> after all. Or, if foo replaces files in bar, bar is allowed to do the
>> same in foo even without declaring so?
>
> I don't know.  dpkg would have to keep record of "replaced" files, and I
> don't know whether it does.  Indeed it can easily happen that you use
> Replaces on a locally created package, and after installing it the
> "replaced" packages gets an update.
>
> What will happen in this case?  Will dpkg give an error, silently
> overwrite the replacing package's files, or ignore them?
>
> TIA, Frank

The replaced package gives an error that it tries to overwrite files
of a different package. Depending on the dpkg config it the either
fails or overwrites.

But that isn't even the worst.

If you remove the replacing package the files of the replaced package
get deleted (rightfully) leaving it in a broken state.


My suggestion would be to not replace files but to divert them. That
is the only way for a file to be in 2 packages that can coexist.
Replaces is realy only working right for moving a file from a to b.

MfG
        Goswin



Reply to: