package opam-repomin

  1. Overview
  2. Docs
Minimize opam repository overlays into one unified repo

Install

dune-project
 Dependency

Authors

Maintainers

Sources

opam-repomin-1.0.0.tbz
sha256=d386aa90c5465b295d9d87de446b65da93bb0fa576fe925a4df48d60abc446b1
sha512=207d89cb7b9fc429ef172529f94d8a8f85a42f0107985f5e3fb23d2944f6b67722fb4dfc41e660e7db14b3135ab908ac1b29421de4b8917a939cbedc98b02489

doc/README.html

opam-repomin

Minimize opam repository overlays using the 0install solver.

Overview

opam-repomin takes an opam repository overlay directory and a full opam-repository, uses the opam-0install solver to determine the minimum set of packages required to make the overlay standalone, and copies the relevant packages to an output directory.

Installation

opam install opam-repomin

Usage

opam-repomin --overlay <overlay-repo> --full <full-repo> --compiler <pkg.version> --output <output-dir>

Options

  • --overlay - Path to the opam repository overlay directory
  • --full - Path to the full opam-repository
  • --compiler - Compiler package to use (e.g., ocaml-base-compiler.5.2.0 or ocaml-variants.5.2.0+options)
  • --output - Output directory for the minimized repository
  • --dry-run - Print what would be copied without actually copying

Example

# Minimize an overlay using OCaml 5.2.0
opam-repomin \
  --overlay ./my-overlay \
  --full ~/.opam/repo/default \
  --compiler ocaml-base-compiler.5.2.0 \
  --output ./minimized-repo

How It Works

  1. Loads all packages from the overlay repository
  2. Loads the full opam-repository
  3. Uses the opam-0install solver to find the minimal set of dependencies needed to install all overlay packages with the specified compiler
  4. Copies only the required package versions from the full repository to the output directory (skipping packages already in the overlay)

License

ISC License. See LICENSE.md.