From 9e02e7ac9f3788a0745122dca426825e44552ce1 Mon Sep 17 00:00:00 2001 From: Dominik Heidler Date: Tue, 23 Jan 2024 11:46:04 +0100 Subject: [PATCH 1/2] Use new osc service run cmd syntax --- release.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release.sh b/release.sh index 7950a9e..912c754 100755 --- a/release.sh +++ b/release.sh @@ -20,7 +20,7 @@ sed -i -e "s/^\(Version: *\)[^ ]*$/\1${version}/" opi.spec osc vc -m "Version ${version}\n${changes}" vi opi.changes osc rm --force opi-*.tar.gz -osc service dr +osc service run osc add opi-*.tar.gz osc st osc diff|bat From 4f74c4136fc917e98d12ee9cb39cfac92e3ed388 Mon Sep 17 00:00:00 2001 From: Dominik Heidler Date: Tue, 23 Jan 2024 11:46:56 +0100 Subject: [PATCH 2/2] Allow selecting mirror 1st time when adding packman repo --- opi/__init__.py | 38 ++++++++++++++++++++++----------- test/01_install_from_packman.py | 7 ++++-- 2 files changed, 31 insertions(+), 14 deletions(-) diff --git a/opi/__init__.py b/opi/__init__.py index 16c6967..e4c2908 100644 --- a/opi/__init__.py +++ b/opi/__init__.py @@ -112,18 +112,32 @@ def expand_vars(s: str) -> str: ############### def add_packman_repo(dup=False): - project = get_distribution(use_releasever_variable=config.get_key_from_config('use_releasever_var')) - project = project.replace(':', '_') - project = project.replace('Factory', 'Tumbleweed') - - add_repo( - filename = 'packman', - 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, - auto_import_keys = global_state.arg_non_interactive - ) + repos_by_alias = {repo.alias: repo for repo in get_repos()} + if 'packman' in repos_by_alias: + print("Installing from existing packman repo") + else: + print("Adding packman repo") + packman_mirrors = { + "ftp.fau.de - University of Erlangen, Germany - 1h sync": "https://ftp.fau.de/packman/", + "ftp.halifax.rwth-aachen.de - University of Aachen, Germany - 1h sync": "https://ftp.halifax.rwth-aachen.de/packman/", + "ftp.gwdg.de - University of Göttingen, Germany - 4h sync": "https://ftp.gwdg.de/pub/linux/misc/packman/", + "mirror.karneval.cz - TES Media, Czech Republic - 1h sync": "https://mirror.karneval.cz/pub/linux/packman/", + "mirrors.aliyun.com - Alibaba Cloud, China - 24h sync": "https://mirrors.aliyun.com/packman/", + } + mirror = ask_for_option(list(packman_mirrors.keys()), 'Pick a mirror near your location (0 to quit):') + mirror = packman_mirrors[mirror] + + project = get_distribution(use_releasever_variable=config.get_key_from_config('use_releasever_var')) + project = project.replace(':', '_') + project = project.replace('Factory', 'Tumbleweed') + add_repo( + filename = 'packman', + name = 'Packman', + url = f'{mirror}/suse/{project}/', + gpgkey = f'https://ftp.fau.de/packman/suse/{project}/repodata/repomd.xml.key', # always fetch gpgkey from FAU server + auto_refresh = config.get_key_from_config('new_repo_auto_refresh'), + priority = 90 + ) if dup: dist_upgrade(from_repo='packman', allow_downgrade=True, allow_vendor_change=True) diff --git a/test/01_install_from_packman.py b/test/01_install_from_packman.py index 9067f92..54d0e97 100755 --- a/test/01_install_from_packman.py +++ b/test/01_install_from_packman.py @@ -14,8 +14,11 @@ c.expect('1. .*Packman Essentials', timeout=10) c.sendline('1') -c.expect('Do you want to reject the key', timeout=10) -c.sendline('t') +c.expect('Pick a mirror near your location', timeout=10) +c.sendline('2') + +c.expect('Import package signing key', timeout=10) +c.sendline('y') c.expect('Overall download size', timeout=60) c.expect('Continue', timeout=60)