OpenBSD::PkgCfl(3p) | Perl Programmers Reference Guide | OpenBSD::PkgCfl(3p)

# NAME

OpenBSD::PkgCfl - "pkg_create(1)" "@conflict" handling

# SYNOPSIS

        use OpenBSD::PkgCfl;
        $clist = OpenBSD::PkgCfl->make_conflicts_list($plist);
        @cfls = $clist->conflicts_with(@pkgnames);
        OpenBSD::PkgCfl::register($plist, $state);
        OpenBSD::PkgCfl::unregister($plist, $state);
        @cfls = OpenBSD::PkgCfl::find_all($plist, $state);

# DESCRIPTION

"OpenBSD::PkgCfl" is the canonical interface to packing-list conflict handling.

Conflict information can be extracted from a packing-list (see OpenBSD::PackingList) through the "OpenBSD::PkgCfl" class method. The result is an opaque object $clist that can be queried to find out which package names conflict with the packing-list. A query of the form "$clist->conflicts_with(@pkgnames)" will extract from the list the package names that actually conflict with the packing-list.

Most handling of conflict information happens through the higher level interface: "OpenBSD::PkgCfl::register", "OpenBSD::PkgCfl::unregister" and "OpenBSD::PkgCfl::find_all". Package tools usually handle installed packages, and this interface automatically takes the initial set of installed packages into account. The "register" and "unregister" functions must be used to add and remove a packing-list from the set of installed packages, where conflict information is concerned.

The "find_all" function can be used to find out about all possible conflicts a new packing-list will entail, before actually adding the package.

The extra argument $state is a hash used to record system-wide options. In this case, it acts as a hidden object that records all conflict information. The hash key "conflict_list" is reserved for that purpose.

2020-12-20 | perl v5.40.1