package cudf

  1. Overview
  2. Docs

Checkers for CUDF documents

Consistency and problem-solution matching.

type inconsistency_reason = [
  1. | `Unsat_dep of (Cudf_types.pkgname * Cudf_types.version) * Cudf_types.vpkgformula
    (*

    unsatisfied dep.

    *)
  2. | `Conflict of (Cudf_types.pkgname * Cudf_types.version) * Cudf_types.vpkglist
    (*

    unsolved conflict(s)

    *)
]
type bad_solution_reason = [
  1. | inconsistency_reason
  2. | `Missing_install of Cudf_types.vpkglist
    (*

    install pkgs missing

    *)
  3. | `Missing_upgrade of Cudf_types.vpkglist
    (*

    upgrade pkgs missing

    *)
  4. | `Unremoved of Cudf_types.vpkglist
    (*

    remove pkgs still there

    *)
  5. | `Downgrade of Cudf_types.vpkglist
    (*

    upgrade pkgs downgraded

    *)
  6. | `Multi_upgrade of Cudf_types.pkgname list
    (*

    upgrade pkgs aren't singleton

    *)
  7. | `Not_kept of Cudf_types.pkgname * Cudf_types.version * Cudf_types.enum_keep
    (*

    unattended "Keep"

    *)
]
val explain_reason : bad_solution_reason -> string

provide a string explaining a given reason, meant for error messages

check whether a given package formula is satisfied by a given package status

  • returns

    true, [] if the formula is satisfied; false, f otherwise, where f is a sub-formula of the input denoting an unsatisfiable formula (ideally, a witness of the unsatisfiability of the input formula)

val disjoint : Cudf.universe -> ?ignore:(Cudf.package -> bool) -> Cudf_types.vpkglist -> bool * Cudf_types.vpkglist

check whether a package list is not satisfied by a given package status

  • returns

    true, [] if the list is disjoint; false, l otherwise, where l is a list of packages satisfied by the universe (ideally, the reason of the non-disjointness)

val is_consistent : Cudf.universe -> bool * inconsistency_reason option
  • returns

    true, None if the given installation is consistent, false, Some r otherwise, where r is the inconsistency reason

val is_solution : (Cudf.universe * Cudf.request) -> Cudf.universe -> bool * bad_solution_reason list

is_solution (status, req) sol checks whether sol fulfills the CUDF upgrade scenario described by (status, req)

Note: the sol package universe must contain all relevant package metadata (e.g. Depends, Conflicts, etc.), copied from status, a compact universe only containing package names and versions won't be enough. To load compact universes see Cudf_parser.load_solution.

Note: in accordance with CUDF semantics, for a solution to be valid, the solution shall correspond to a consistent universe. A solution that does satisfy user request, but at the same time proposes an inconsistent universe (as per Cudf_checker.is_consistent) will be reported by is_solution as not being a valid solution.

  • returns

    true, [] if this is the case, false, l otherwise, where r explains why the solution is bad

OCaml

Innovation. Community. Security.