[Dev] problems with replacements for blacklisted packages

Luke Shumaker lukeshu at lukeshu.com
Sat Dec 23 16:36:03 GMT 2017

The following is a discussion of the semantics of
provides/conflicts/replaces.  It uses b43-fwcutter as an example, but
isn't about b43-fwcutter; it is written accepting the everything in my
previous email as accurate; which isn't true.  What we actually should
do is keep blacklisting core/b43-fwcutter, remove the
/usr/bin/b43-fwcutter program from libre/b43-tools, and have b43-tools
make no reference to b43-fwcutter in any of
provides/conflicts/replaces (perhaps note the absence of b43-fwcutter
in the pkgdesc).  But, in order to more directly and clearly address
Bill's points, I'm going to pretend that's not true, and that the
b43-fwcutter program is fine.

On Sat, 23 Dec 2017 02:05:08 -0500,
bill-auger wrote:
> On 12/22/2017 10:06 PM, Luke Shumaker wrote:
> >  - have libre/b43-tools provides=() and conflicts=() b43-fwcutter, but
> >    not replaces=()
> just to point out again what i learned from reading the archwiki on the
> topic of provides vs. conflicts vs. replaces that this suggestion is not
> in line with the original intention

It surely is in line with the original intention.  core/b43-fwcutter
provides the /usr/bin/b43-fwcutter program (and man page);
libre/b43-tools also provides that program, as well as a few others.

> to re-iterate the semantics as the upstream describes it:
> * 'provides' - is used for dependency checking - multiple packages may
> 'provides' (and therefore satisfy) the same dependency and any number of
> them may be installed at the same time

If a program has b43-fwcutter as a dependency, it would be satisfied
by the version of /usr/bin/b43-fwcutter included in libre/b43-tools
(it is built from exactly the same sources as the version in
core/b43-fwcutter; `diff -r` says so).

> * 'conflicts' - is used for conflict resolution - at most one
> conflicting package may be installed at any time - if you try to install
> a conflicting package then the package manager will ask to remove the
> one that is installed

Both core/b43-fwcutter and libre/b43-tools include the file
/usr/bin/b43-fwcutter; they cannot both be installed at the same time.

> * replaces - is the important one for this discussion - according to the
> docs, when any new package is added to the repo that states that it
> 'replaces' another, it has the definite, immediate, and specific effect
> of forcefully removing the specified package from any user's system, and
>  without asking (i think), and replacing it with the new replacement
> package - this happens the next time that the user `pacman -Syu` and it
> may even ignore any "hold" on the old package

Pacman will prompt "Replace A with B? [Y/n]:".  This can be disabled
by adding the replacement to IgnorePkg in pacman.conf.

>                                               - this was intended to be
> used only for emergencies if, for example, some malware got into the system

This isn't only for emergencies.  It is used whenever one package is
dropped in favor of another package (perhaps just a package rename).
When eigen3 got renamed to eigen, eigen now replaces=(eigen3).  When
libdbus got merged in to the dbus package, dbus now replaces=(libdbus)
because otherwise -Syu wouldn't upgrade it for a user who had libdbus
installed, but not dbus; they'd silently end up with an old libdbus
package (it would show up in `pacman -Qm` though).

If we wanted drop core/b43-fwcutter from our repos (blacklist it),
then libre/b43-tools *should* replaces=() it because we are dropping
one implementation of /usr/bin/b43-fwcutter for another, and the new
one should replace the old one.

One way of looking at it is that provides=() and conflicts=() affect
all users, while replaces=() only affects *upgrades*, not *new

> again im not saying that breaking convention is bad but if the package
> manager has these specific behaviors triggered by these lists care must
> be taken to ensure that the new semantics have no unintended practical
> side-effects
> if the suggestion here is for parabola to use the 'replaces' attribute
> for some purpose other than what is described above it may be instead a
> better idea to introduce a new list such as: 'libre_replaces=()' that
> pacman will ignore

We do use replaces=() for the intended purpose.  A user migrating from
Arch should be asked "Replace linux with linux-libre?", "Replace
firefox with iceweasel?"  From the user's/pacman's perspective,
upstream dropped linux in favor of linux-libre; that's exactly what
replaces=() is for.

Happy hacking,
~ Luke Shumaker

More information about the Dev mailing list