openSUSE / zypper

World's most powerful command line package manager
http://en.opensuse.org/Portal:Zypper
Other
412 stars 113 forks source link

Support using `--installroot` without requiring an explicit `--releasever` #566

Open polarathene opened 2 months ago

polarathene commented 2 months ago

Given that --installroot uses host repos, is it not possible to infer the --releasever default so that it can be omitted like when not using --installroot?

docker run --rm -it registry.suse.com/bci/bci-base
zypper --releasever 15.6 --gpg-auto-import-keys --installroot /root-fs install -y glibc

For reference, zypper --help output:

--releasever            Set the value of $releasever in all .repo files (default: distribution version)
--installroot <DIR>     Operate on a different root directory, but share repositories with the host.

dnf previously had this same concern, but with dnf5 there is a --use-host-config option which avoids requiring an explicit value (_or sourcing it from VERSION_ID in /etc/os-release_). Perhaps that would be acceptable?

dnf --installroot /root-fs --use-host-config install -y glibc

dnf --help equivalent output:

--installroot=ABSOLUTE_PATH            set install root
--use-host-config                      use configuration, reposdir, and vars from the host system rather than the installroot
--releasever=RELEASEVER                override the value of $releasever in config and repo files