lib.distros.suse.Distro._install_local_files(): Use rpm #16

Merged
Jan Lindemann merged 1 commit from jan/feature/20260615-lib-distros-suse-distro-install-local-files-use-rpm into master 2026-06-15 08:25:39 +02:00 AGit
Showing only changes of commit bfad94c196 - Show all commits

lib.distros.suse.Distro._install_local_files(): Use rpm
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 3m2s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 3m8s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 3m5s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m40s
CI / Packaging test (push) Successful in 0s

OpenSUSE leaves installing local packages to the default implementation in lib.Distro._install_local_files(), which passes the package path to the package manager, i.e. zypper in OpenSUSE's case. That has advantages, namely automatic installation of dependencies, but also disadvantages, namely the attempt to install dependencies even if the package manager is disfunctional, possibly because an installed package containing installation sources is broken.

That could lead to a deadlock when trying to install a fixed package. I see two ways out: Support an additional flag to jw-pkg's install command which selects whether or not dependencies shall be resolved along, or just use rpm directly for all local install attempts.

The latter is the less fancy way to handle this, so as a first step make it the default by overriding suse.Distro._install_local_files().

Signed-off-by: Jan Lindemann <jan@janware.com>
Jan Lindemann 2026-06-15 07:30:51 +02:00
Signed by: Jan Lindemann
GPG key ID: 3750640C9E25DD61

View file

@ -73,6 +73,11 @@ class Distro(Base):
cmd += names
await self.zypper(cmd)
async def _install_local_files(
self, paths: Iterable[str], only_update: bool
) -> None:
await self.rpm(['-U', '--reinstall', *paths])
async def _delete(self, names: Iterable[str]) -> None:
await self.rpm(['-e', *names], sudo = True)