]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
zypper: pass --releasever option
authorAntonio Alvarez Feijoo <antonio.feijoo@suse.com>
Mon, 27 Jan 2025 13:30:31 +0000 (14:30 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 27 Jan 2025 13:38:08 +0000 (14:38 +0100)
zypper allows to use the `$releasever` variable in repo URLs (see zypper(8) man
page). When mkosi uses zypper repos from the host instead of the default ones,
this variable needs to be replaced with the host's `VERSION_ID`, otherwise repo
URLs are incomplete.

mkosi/installer/zypper.py

index fc5625f76792515e5d2b6ba847092809239ef655..b39377e28d24538d4ed45e06f9d48fecfb958c57 100644 (file)
@@ -109,6 +109,7 @@ class Zypper(PackageManager):
             "--cache-dir=/var/cache/zypp",
             "--non-interactive",
             "--no-refresh",
+            f"--releasever={context.config.release}",
             *(["--gpg-auto-import-keys"] if context.config.repository_key_fetch else []),
             *(["--no-gpg-checks"] if not context.config.repository_key_check else []),
             *([f"--plus-content={repo}" for repo in context.config.repositories]),