konflux-ci / rpm-lockfile-prototype

GNU General Public License v3.0
3 stars 10 forks source link

Provide a simple HOWTO documentation for the --local-system option #48

Open praiskup opened 2 months ago

praiskup commented 2 months ago
  1. I install the tool.

  2. I try it:

    $ rpm-lockfile-prototype usage: rpm-lockfile-prototype [-h] [-f CONTAINERFILE | --image IMAGE | --local-system | --bare | --rpm-ostree-treefile RPM_OSTREE_TREEFILE] [--flatpak] [--debug] [--arch ARCH] [--pull {always,missing,never,newer}] [--outfile OUTFILE] [--print-schema] [--allowerasing] INPUT_FILE rpm-lockfile-prototype: error: the following arguments are required: INPUT_FILE

  3. Hmm, there's --local-system, let's try!

    $ rpm-lockfile-prototype --local-system usage: rpm-lockfile-prototype [-h] [-f CONTAINERFILE | --image IMAGE | --local-system | --bare | --rpm-ostree-treefile RPM_OSTREE_TREEFILE] [--flatpak] [--debug] [--arch ARCH] [--pull {always,missing,never,newer}] [--outfile OUTFILE] [--print-schema] [--allowerasing] INPUT_FILE rpm-lockfile-prototype: error: the following arguments are required: INPUT_FILE

  4. let's read the docs:

    Resolve in the current system (--local-system). This is probably not useful for anything.

    Ok... it's not useful, but I still want to try it!

  5. What's the INPUT_FILE?

    The input file tells this tool where to look for RPMs and what packages to install. If not specified, rpms.in.yaml from current working directory will be used.

    Hm, but there's no rpms.in.yaml example, nah. And the YAML is too complicated for me to provide in one minute. Nah.

lubomir commented 2 months ago

The local mode is tricky to get working. You need to provide baseurls for repos with appropriate packages, but usually

This would be great if it worked, but there's no support for mirrorlist at the moment.

contentOrigin:
  repofiles:
    - /etc/yum.repos.d/fedora.repo
    - /etc/yum.repos.d/fedora-updates.repo
packages:
 - vim-enhanced
context:
  localSystem: true

But since it doesn't, you could use something like:

contentOrigin:
  repos:
    - repoid: fedora
      baseurl: https://<SOME_MIRROR>/pub/linux/fedora/linux/releases/40/Everything/$basearch/os/
packages:
 - vim-enhanced
context:
  localSystem: true
lubomir commented 1 month ago

50 now has an example of the local usage, as the tool got support for metalink/mirrorlist.