Skip to content

Commit

Permalink
Automatically import packman key in non-interactive mode
Browse files Browse the repository at this point in the history
Fixes #164
  • Loading branch information
asdil12 committed Dec 8, 2023
1 parent 8fd56ee commit 74a4bcd
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
3 changes: 2 additions & 1 deletion opi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ def add_packman_repo(dup=False):
name = 'Packman',
url = f'https://ftp.gwdg.de/pub/linux/misc/packman/suse/{project}/',
auto_refresh = config.get_key_from_config('new_repo_auto_refresh'),
priority = 90
priority = 90,
auto_import_keys = global_state.arg_non_interactive
)

if dup:
Expand Down
20 changes: 20 additions & 0 deletions test/08_install_from_packman_non_interactive.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/python3

import sys
import pexpect
import subprocess

c = pexpect.spawn('./bin/opi -n x265', logfile=sys.stdout.buffer, echo=False)

c.expect('1. x265\r\n')
c.expect('Pick a number')

c.expect('1. .*Packman Essentials', timeout=10)

c.expect('Overall download size', timeout=60)
c.interact()
c.wait()
c.close()
assert c.exitstatus == 0, f'Exit code: {c.exitstatus}'

subprocess.check_call(['rpm', '-qi', 'x265'])

0 comments on commit 74a4bcd

Please sign in to comment.