5.15. Conflict Handling

There are three different variables to register a conflict between packages and ports: CONFLICTS, CONFLICTS_INSTALL and CONFLICTS_BUILD.

Note:

The conflict variables automatically set the variable IGNORE, which is more fully documented in Section 13.14, “Marking a Port Not Installable with BROKEN, FORBIDDEN, or IGNORE.

When removing one of several conflicting ports, it is advisable to retain CONFLICTS in those other ports for a few months to cater for users who only update once in a while.

CONFLICTS_INSTALL

If the package cannot coexist with other packages (because of file conflicts, runtime incompatibilities, etc.). CONFLICTS_INSTALL check is done after the build stage and prior to the install stage.

CONFLICTS_BUILD

If the port cannot be built when other specific ports are already installed. Build conflicts are not recorded in the resulting package.

CONFLICTS

If the port cannot be built if a certain port is already installed and the resulting package cannot coexist with the other package. CONFLICTS check is done prior to the build stage and prior to the install stage.

The most common content of one of these variable is the package base of another port. The package base is the package name without the appended version, it can be obtained by running make -V PKGBASE.

Example 5.46. Basic usage of CONFLICTS*

dns/bind99 cannot be installed if dns/bind910 is present because they install same files. First gather the package base to use:

% make -C dns/bind99 -V PKGBASE
bind99
% make -C dns/bind910 -V PKGBASE
bind910

Then add to the Makefile of dns/bind99:

CONFLICTS_INSTALL=	bind910

And add to the Makefile of dns/bind910:

CONFLICTS_INSTALL=	bind99

Sometime, only some version of another port is incompatible, in this case, use the full package name, with the version, and use shell globs, like * and ? to make sure all possible versions are matched.

Example 5.47. Using CONFLICTS* With Globs.

From versions from 2.0 and up-to 2.4.1_2, deskutils/gnotime used to install a bundled version of databases/qof.

To reflect this past, the Makefile of databases/qof contains:

CONFLICTS_INSTALL=	gnotime-2.[0-3]* \
			gnotime-2.4.0* gnotime-2.4.1 \
			gnotime-2.4.1_[12]

The first entry match versions 2.0 through 2.3, the second all the revisions of 2.4.0, the third the exact 2.4.1 version, and the last the first and second revisions of the 2.4.1 version.

deskutils/gnotime does not have any conflicts line because its current version does not conflict with anything else.


All FreeBSD documents are available for download at https://download.freebsd.org/ftp/doc/

Questions that are not answered by the documentation may be sent to <freebsd-questions@FreeBSD.org>.
Send questions about this document to <freebsd-doc@FreeBSD.org>.