From: Daan De Meyer Date: Mon, 30 Sep 2024 12:23:35 +0000 (+0200) Subject: opensuse: Force rpm ndb backend X-Git-Tag: v25~254^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F3081%2Fhead;p=thirdparty%2Fmkosi.git opensuse: Force rpm ndb backend OpenSUSE's rpm is not built with the sqlite db backend so let's make sure the rpm DB can be read inside the image by OpenSUSE's rpm by forcing the ndb backend to be used. --- diff --git a/mkosi/distributions/opensuse.py b/mkosi/distributions/opensuse.py index eab65f1ef..6ab0bf331 100644 --- a/mkosi/distributions/opensuse.py +++ b/mkosi/distributions/opensuse.py @@ -49,7 +49,7 @@ class Installer(DistributionInstaller): @classmethod def setup(cls, context: Context) -> None: - setup_rpm(context) + setup_rpm(context, dbbackend="ndb") zypper = context.config.find_binary("zypper") if zypper: diff --git a/mkosi/installer/rpm.py b/mkosi/installer/rpm.py index e7c3e37f5..3f27a7d66 100644 --- a/mkosi/installer/rpm.py +++ b/mkosi/installer/rpm.py @@ -63,7 +63,12 @@ def find_rpm_gpgkey( return None -def setup_rpm(context: Context, *, dbpath: str = "/usr/lib/sysimage/rpm") -> None: +def setup_rpm( + context: Context, + *, + dbpath: str = "/usr/lib/sysimage/rpm", + dbbackend: Optional[str] = None, +) -> None: confdir = context.sandbox_tree / "etc/rpm" confdir.mkdir(parents=True, exist_ok=True) if not (confdir / "macros.lang").exists() and context.config.locale: @@ -72,6 +77,9 @@ def setup_rpm(context: Context, *, dbpath: str = "/usr/lib/sysimage/rpm") -> Non if not (confdir / "macros.dbpath").exists(): (confdir / "macros.dbpath").write_text(f"%_dbpath {dbpath}") + if dbbackend: + (confdir / "macros.db_backend").write_text(f"%_db_backend {dbbackend}") + plugindir = Path( run( ["rpm", "--eval", "%{__plugindir}"],