jw.pkg.cmds.distro.backend.Base: sudo --login

On OpenSUSE, run sudo with --login. This picks up a possible
ZYPP_CONF config variable definition in /etc/profile.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-02-12 20:33:52 +01:00
commit ffb84ad8c0

View file

@ -9,7 +9,8 @@ class Base(BackendCmd):
super().__init__(parent) super().__init__(parent)
async def zypper(self, *args): async def zypper(self, *args):
cmd = ['/usr/bin/zypper'] # Run sudo --login, because /etc/profile may modify ZYPP_CONF
cmd = ['--login', '/usr/bin/zypper']
if not self.interactive: if not self.interactive:
cmd.extend(['--non-interactive', '--gpg-auto-import-keys', '--no-gpg-checks']) cmd.extend(['--non-interactive', '--gpg-auto-import-keys', '--no-gpg-checks'])
cmd.extend(args) cmd.extend(args)