distros.suse: Force non-interactive resolution
Updates running in non-interactive mode are passed
--force-resolution --auto-agree-with-licenses
to get more snakes out of the way, as recently during CI:
# make pkg-install-testbuild-deps /usr/bin/which: no xdg-open in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin)
/usr/bin/python3.13 ./scripts/jw-pkg.py -p ./.. -t . --topdir-format absolute --interactive=false pkg install "make" "time" "xdg-utils" "coreutils" "cpio" "git-core" "bash" "python3" "sudo" "gawk" "pkg-config" "python3-isort" "python3-yapf" "python3-ruff" "python3-pyright" "rpmbuild" "python3-base",---- file://local: Running /usr/bin/zypper --non-interactive --gpg-auto-import-keys --no-gpg-checks install make time xdg-utils coreutils cpio git-core bash python3 sudo gawk pkg-config python3-isort python3-yapf python3-ruff python3-pyright rpmbuild python3-base - > | Loading repository data... | Reading installed packages... | 'sudo' is already installed. | No update candidate for 'sudo-1.9.17p2-2.2.x86_64'. The highest available version is already installed. | 'bash' is already installed. | No update candidate for 'bash-5.3.9-6.4.x86_64'. The highest available version is already installed. | 'python3' not found in package names. Trying capabilities. | 'python313' providing 'python3' is already installed. | 'coreutils' is already installed. | No update candidate for 'coreutils-9.11-3.1.x86_64'. The highest available version is already installed. | 'pkg-config' not found in package names. Trying capabilities. | 'make' is already installed. | No update candidate for 'make-4.4.1-3.5.x86_64'. The highest available version is already installed. | 'python3-base' not found in package names. Trying capabilities. | 'python313-base' providing 'python3-base' is already installed. | 'rpmbuild' not found in package names. Trying capabilities. | 'git-core' is already installed. | No update candidate for 'git-core-2.54.0-2.1.x86_64'. The highest available version is already installed. | 'python3-pyright' not found in package names. Trying capabilities. | 'python3-ruff' not found in package names. Trying capabilities. | 'python3-isort' not found in package names. Trying capabilities. | 'python3-yapf' not found in package names. Trying capabilities. | Resolving package dependencies... | | Problem: 1: the installed busybox-gawk-1.37.0-41.4.noarch conflicts with 'gawk' provided by the to be installed gawk-5.4.0-1.1.x86_64 | Solution 1: Following actions will be done: | do not install gawk-5.4.0-1.1.x86_64 | do not ask to install a solvable providing rpmbuild | Solution 2: deinstallation of busybox-gawk-1.37.0-41.4.noarch | | Choose from above solutions by number or cancel [1/2/c/d/?] (c): c `---- file://local: Running /usr/bin/zypper --non-interactive --gpg-auto-import-keys --no-gpg-checks install make time xdg-utils coreutils cpio git-core bash python3 sudo gawk pkg-config python3-isort python3-yapf python3-ruff python3-pyright rpmbuild python3-base - <
Signed-off-by: Jan Lindemann <jan@janware.com>
|
|
@ -14,6 +14,12 @@ if TYPE_CHECKING:
|
||||||
|
|
||||||
class Distro(Base):
|
class Distro(Base):
|
||||||
|
|
||||||
|
@property
|
||||||
|
def __update_extra_opts(self) -> list[str]:
|
||||||
|
if self.interactive:
|
||||||
|
return []
|
||||||
|
return ['--force-resolution', '--auto-agree-with-licenses']
|
||||||
|
|
||||||
async def zypper(
|
async def zypper(
|
||||||
self, args: list[str], verbose: bool = True, sudo: bool = True
|
self, args: list[str], verbose: bool = True, sudo: bool = True
|
||||||
) -> Result:
|
) -> Result:
|
||||||
|
|
@ -44,6 +50,7 @@ class Distro(Base):
|
||||||
args = ['dup', '--force-resolution', '--auto-agree-with-licenses']
|
args = ['dup', '--force-resolution', '--auto-agree-with-licenses']
|
||||||
if download_only:
|
if download_only:
|
||||||
args.append('--download-only')
|
args.append('--download-only')
|
||||||
|
args += self.__update_extra_opts
|
||||||
await self.zypper(args)
|
await self.zypper(args)
|
||||||
|
|
||||||
async def _reboot_required(self, verbose: bool) -> bool:
|
async def _reboot_required(self, verbose: bool) -> bool:
|
||||||
|
|
@ -61,8 +68,10 @@ class Distro(Base):
|
||||||
return await query_packages(names, ec = self.ctx)
|
return await query_packages(names, ec = self.ctx)
|
||||||
|
|
||||||
async def _install(self, names: Iterable[str], only_update: bool) -> None:
|
async def _install(self, names: Iterable[str], only_update: bool) -> None:
|
||||||
cmd = 'update' if only_update else 'install'
|
cmd = ['update' if only_update else 'install']
|
||||||
await self.zypper([cmd, *names])
|
cmd += self.__update_extra_opts
|
||||||
|
cmd += names
|
||||||
|
await self.zypper(cmd)
|
||||||
|
|
||||||
async def _delete(self, names: Iterable[str]) -> None:
|
async def _delete(self, names: Iterable[str]) -> None:
|
||||||
await self.rpm(['-e', *names], sudo = True)
|
await self.rpm(['-e', *names], sudo = True)
|
||||||
|
|
|
||||||