mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-08 15:34:15 +02:00
[arch] improvement: new property 'prefer_repository_provider'
This commit is contained in:
@@ -39,4 +39,5 @@ class ArchConfigManager(YAMLConfigManager):
|
||||
'aur_idx_exp': 1,
|
||||
'categories_exp': 24,
|
||||
'aur_rebuild_detector': False,
|
||||
"aur_rebuild_detector_no_bin": True}
|
||||
"aur_rebuild_detector_no_bin": True,
|
||||
"prefer_repository_provider": True}
|
||||
|
||||
@@ -2082,6 +2082,7 @@ class ArchManager(SoftwareManager):
|
||||
remote_provided_map=context.get_remote_provided_map(),
|
||||
remote_repo_map=context.get_remote_repo_map(),
|
||||
automatch_providers=context.config['automatch_providers'],
|
||||
prefer_repository_provider=context.config['prefer_repository_provider'],
|
||||
watcher=context.watcher)
|
||||
|
||||
tf = time.time()
|
||||
@@ -2197,6 +2198,7 @@ class ArchManager(SoftwareManager):
|
||||
remote_provided_map=remote_provided_map,
|
||||
remote_repo_map=remote_repo_map,
|
||||
automatch_providers=context.config['automatch_providers'],
|
||||
prefer_repository_provider=context.config['prefer_repository_provider'],
|
||||
sort=False)
|
||||
|
||||
if missing_deps is None:
|
||||
@@ -2823,6 +2825,12 @@ class ArchManager(SoftwareManager):
|
||||
tooltip_key='arch.config.automatch_providers.tip',
|
||||
value=bool(arch_config['automatch_providers']),
|
||||
max_width=max_width),
|
||||
self._gen_bool_selector(id_='prefer_repo_provider',
|
||||
label_key='arch.config.prefer_repository_provider',
|
||||
tooltip_key='arch.config.prefer_repository_provider.tip',
|
||||
value=bool(arch_config['prefer_repository_provider']),
|
||||
max_width=max_width,
|
||||
tooltip_params=['AUR']),
|
||||
self._gen_bool_selector(id_='check_dependency_breakage',
|
||||
label_key='arch.config.check_dependency_breakage',
|
||||
tooltip_key='arch.config.check_dependency_breakage.tip',
|
||||
@@ -2935,6 +2943,7 @@ class ArchManager(SoftwareManager):
|
||||
arch_config['mirrors_sort_limit'] = form.get_component('mirrors_sort_limit').get_int_value()
|
||||
arch_config['repositories_mthread_download'] = form.get_component('mthread_download').get_selected()
|
||||
arch_config['automatch_providers'] = form.get_single_select_component('autoprovs').get_selected()
|
||||
arch_config['prefer_repository_provider'] = form.get_single_select_component('prefer_repo_provider').get_selected()
|
||||
arch_config['edit_aur_pkgbuild'] = form.get_single_select_component('edit_aur_pkgbuild').get_selected()
|
||||
arch_config['aur_remove_build_dir'] = form.get_single_select_component('aur_remove_build_dir').get_selected()
|
||||
arch_config['aur_build_dir'] = form.get_component('aur_build_dir').file_path
|
||||
|
||||
@@ -287,7 +287,7 @@ class DependenciesAnalyser:
|
||||
missing_deps: Set[Tuple[str, str]],
|
||||
remote_provided_map: Dict[str, Set[str]], remote_repo_map: Dict[str, str],
|
||||
repo_deps: Set[str], aur_deps: Set[str], deps_data: Dict[str, dict], watcher: ProcessWatcher,
|
||||
automatch_providers: bool, dependent: Optional[str] = None):
|
||||
automatch_providers: bool, prefer_repository_provider: bool, dependent: Optional[str] = None):
|
||||
|
||||
repo_matches = None
|
||||
|
||||
@@ -309,6 +309,16 @@ class DependenciesAnalyser:
|
||||
|
||||
repo_matches.append((pkgname, repo, data))
|
||||
|
||||
if prefer_repository_provider and repo_matches and len(repo_matches) == 1:
|
||||
pkg_name, pkg_repo, pkg_data = repo_matches[0]
|
||||
missing_deps.add((pkg_name, pkg_repo))
|
||||
repo_deps.add(pkg_name)
|
||||
|
||||
if pkg_data:
|
||||
deps_data[pkg_name] = pkg_data
|
||||
|
||||
return
|
||||
|
||||
aur_matches = None
|
||||
|
||||
if aur_index:
|
||||
@@ -379,7 +389,7 @@ class DependenciesAnalyser:
|
||||
remote_provided_map: Dict[str, Set[str]], remote_repo_map: Dict[str, str],
|
||||
aur_index: Iterable[str], deps_checked: Set[str], deps_data: Dict[str, dict],
|
||||
sort: bool, watcher: ProcessWatcher, choose_providers: bool = True,
|
||||
automatch_providers: bool = False) -> Optional[List[Tuple[str, str]]]:
|
||||
automatch_providers: bool = False, prefer_repository_provider: bool = False) -> Optional[List[Tuple[str, str]]]:
|
||||
sorted_deps = [] # it will hold the proper order to install the missing dependencies
|
||||
|
||||
missing_deps, repo_missing, aur_missing = set(), set(), set()
|
||||
@@ -406,6 +416,7 @@ class DependenciesAnalyser:
|
||||
repo_deps=repo_missing, aur_deps=aur_missing, watcher=watcher,
|
||||
deps_data=deps_data,
|
||||
automatch_providers=automatch_providers,
|
||||
prefer_repository_provider=prefer_repository_provider,
|
||||
dependent=p)
|
||||
else:
|
||||
version_pattern = '{}='.format(dep_name)
|
||||
@@ -425,6 +436,7 @@ class DependenciesAnalyser:
|
||||
watcher=watcher,
|
||||
deps_data=deps_data,
|
||||
automatch_providers=automatch_providers,
|
||||
prefer_repository_provider=prefer_repository_provider,
|
||||
dependent=p)
|
||||
else:
|
||||
self._fill_missing_dep(dep_name=dep_name, dep_exp=dep, aur_index=aur_index,
|
||||
@@ -435,6 +447,7 @@ class DependenciesAnalyser:
|
||||
watcher=watcher,
|
||||
deps_data=deps_data,
|
||||
automatch_providers=automatch_providers,
|
||||
prefer_repository_provider=prefer_repository_provider,
|
||||
dependent=p)
|
||||
|
||||
if missing_deps:
|
||||
@@ -446,7 +459,8 @@ class DependenciesAnalyser:
|
||||
remote_provided_map=remote_provided_map,
|
||||
remote_repo_map=remote_repo_map,
|
||||
automatch_providers=automatch_providers,
|
||||
choose_providers=False)
|
||||
choose_providers=False,
|
||||
prefer_repository_provider=prefer_repository_provider)
|
||||
|
||||
if missing_subdeps:
|
||||
missing_deps.update(missing_subdeps)
|
||||
@@ -461,7 +475,8 @@ class DependenciesAnalyser:
|
||||
remote_provided_map=remote_provided_map, remote_repo_map=remote_repo_map,
|
||||
watcher=watcher, sort=sort, already_checked=deps_checked,
|
||||
aur_idx=aur_index, deps_data=deps_data,
|
||||
automatch_providers=automatch_providers)
|
||||
automatch_providers=automatch_providers,
|
||||
prefer_repository_provider=prefer_repository_provider)
|
||||
|
||||
return sorted_deps
|
||||
|
||||
@@ -514,7 +529,8 @@ class DependenciesAnalyser:
|
||||
provided_map: Dict[str, Set[str]], remote_repo_map: Dict[str, str],
|
||||
already_checked: Set[str], remote_provided_map: Dict[str, Set[str]],
|
||||
deps_data: Dict[str, dict], aur_idx: Iterable[str], sort: bool,
|
||||
watcher: ProcessWatcher, automatch_providers: bool) -> Optional[List[Tuple[str, str]]]:
|
||||
watcher: ProcessWatcher, automatch_providers: bool,
|
||||
prefer_repository_provider: bool) -> Optional[List[Tuple[str, str]]]:
|
||||
"""
|
||||
:param missing_deps:
|
||||
:param provided_map:
|
||||
@@ -526,6 +542,7 @@ class DependenciesAnalyser:
|
||||
:param sort:
|
||||
:param watcher:
|
||||
:param automatch_providers
|
||||
:param prefer_repository_provider
|
||||
:return: all deps sorted or None if the user declined the providers options
|
||||
"""
|
||||
|
||||
@@ -583,7 +600,8 @@ class DependenciesAnalyser:
|
||||
remote_repo_map=remote_repo_map,
|
||||
watcher=watcher,
|
||||
choose_providers=True,
|
||||
automatch_providers=automatch_providers)
|
||||
automatch_providers=automatch_providers,
|
||||
prefer_repository_provider=prefer_repository_provider)
|
||||
|
||||
if providers_deps is None: # it means the user called off the installation process
|
||||
return
|
||||
@@ -610,7 +628,8 @@ class DependenciesAnalyser:
|
||||
remote_repo_map=remote_repo_map, already_checked=already_checked,
|
||||
aur_idx=aur_idx, remote_provided_map=remote_provided_map,
|
||||
deps_data=deps_data, sort=False, watcher=watcher,
|
||||
automatch_providers=automatch_providers):
|
||||
automatch_providers=automatch_providers,
|
||||
prefer_repository_provider=prefer_repository_provider):
|
||||
return
|
||||
|
||||
if sort:
|
||||
|
||||
@@ -73,6 +73,8 @@ arch.config.optimize=Optimize {}
|
||||
arch.config.optimize.tip=La configuració optimitzada s'utilitzarà per fer més ràpida la instal·lació, actualització i reversió dels paquets, en cas contrari s'utilitzarà la configuració del sistema.
|
||||
arch.config.pacman_mthread_download=Multithreaded download (repositories)
|
||||
arch.config.pacman_mthread_download.tip=Whether the repository packages should be downloaded with a tool that works with threads (it may be faster). pacman-mirrors must be installed.
|
||||
arch.config.prefer_repository_provider=Prefer repository dependencies
|
||||
arch.config.prefer_repository_provider.tip=Automatically picks the single package from the repositories among several external ({}) available as the provider for a given dependency
|
||||
arch.config.refresh_mirrors=Refresh mirrors on startup
|
||||
arch.config.refresh_mirrors.tip=Refresh the package mirrors once a day on startup
|
||||
arch.config.repos=Repositories packages
|
||||
|
||||
@@ -73,6 +73,8 @@ arch.config.optimize=Optimize {}
|
||||
arch.config.optimize.tip=Optimized settings will be used in order to make the packages installation, upgrading and downgrading faster, otherwise the system settings will be used
|
||||
arch.config.pacman_mthread_download=Multithreaded download (repositories)
|
||||
arch.config.pacman_mthread_download.tip=Whether the repository packages should be downloaded with a tool that works with threads (it may be faster). pacman-mirrors must be installed.
|
||||
arch.config.prefer_repository_provider=Prefer repository dependencies
|
||||
arch.config.prefer_repository_provider.tip=Automatically picks the single package from the repositories among several external ({}) available as the provider for a given dependency
|
||||
arch.config.refresh_mirrors=Refresh mirrors on startup
|
||||
arch.config.refresh_mirrors.tip=Refresh the package mirrors once a day on startup
|
||||
arch.config.repos=Repositories packages
|
||||
|
||||
@@ -73,6 +73,8 @@ arch.config.optimize=Optimize {}
|
||||
arch.config.optimize.tip=Optimized settings will be used in order to make the packages installation, upgrading and downgrading faster, otherwise the system settings will be used
|
||||
arch.config.pacman_mthread_download=Multi-threaded download (repositories)
|
||||
arch.config.pacman_mthread_download.tip=Whether the repository packages should be downloaded with a tool that works with threads (it may be faster). pacman-mirrors must be installed.
|
||||
arch.config.prefer_repository_provider=Prefer repository dependencies
|
||||
arch.config.prefer_repository_provider.tip=Automatically picks the single package from the repositories among several external ({}) available as the provider for a given dependency
|
||||
arch.config.refresh_mirrors=Refresh mirrors on startup
|
||||
arch.config.refresh_mirrors.tip=Refresh the package mirrors once a day on startup
|
||||
arch.config.repos=Repositories packages
|
||||
|
||||
@@ -73,6 +73,8 @@ arch.config.optimize=Optimizar {}
|
||||
arch.config.optimize.tip=Se usará la configuración optimizada para que la instalación, actualización y reversión de los paquetes sean más rápidas, de lo contrario se usará la configuración del sistema
|
||||
arch.config.pacman_mthread_download=Descarga segmentada (repositorios)
|
||||
arch.config.pacman_mthread_download.tip=Si los paquetes de los repositorios deben descargarse con una herramienta que usa segmentación/threads (puede ser más rápido). pacman-mirrors necesita estar instalado.
|
||||
arch.config.prefer_repository_provider=Preferir dependencias de repositorio
|
||||
arch.config.prefer_repository_provider.tip=Elige automáticamente el paquete unico de los repositorios entre varios externos ({}) disponibles como el proveedor para una dependencia
|
||||
arch.config.refresh_mirrors=Actualizar espejos al iniciar
|
||||
arch.config.refresh_mirrors.tip=Actualiza los espejos de paquetes una vez al día al iniciar
|
||||
arch.config.repos=Paquetes de repositorios
|
||||
|
||||
@@ -73,6 +73,8 @@ arch.config.optimize=Optimizer {}
|
||||
arch.config.optimize.tip=Utiliser des paramètres optimisés pour rendre l'installation, mise à jour et downgrade des paquets plus rapide. À défaut, les paramètres systèmes seront utilisés.
|
||||
arch.config.pacman_mthread_download=Téléchargement parallèle (repos)
|
||||
arch.config.pacman_mthread_download.tip=Si il faut utiliser un outil qui télécharge les paquets du répos en parallèle (plus rapide). pacman-mirrors doit être installé.
|
||||
arch.config.prefer_repository_provider=Prefer repository dependencies
|
||||
arch.config.prefer_repository_provider.tip=Automatically picks the single package from the repositories among several external ({}) available as the provider for a given dependency
|
||||
arch.config.refresh_mirrors=Actualiser les miroirs au démarrage
|
||||
arch.config.refresh_mirrors.tip=Actualiser les miroirs du paquet une fois par jour au démarrage
|
||||
arch.config.repos=Repos des paquets
|
||||
|
||||
@@ -73,6 +73,8 @@ arch.config.optimize=Optimize {}
|
||||
arch.config.optimize.tip=Verranno utilizzate le impostazioni ottimizzate per velocizzare l'installazione, l'aggiornamento e l'inversione dei pacchetti, altrimenti verranno utilizzate le impostazioni di sistema
|
||||
arch.config.pacman_mthread_download=Multithreaded download (repositories)
|
||||
arch.config.pacman_mthread_download.tip=Whether the repository packages should be downloaded with a tool that works with threads (it may be faster). pacman-mirrors must be installed.
|
||||
arch.config.prefer_repository_provider=Prefer repository dependencies
|
||||
arch.config.prefer_repository_provider.tip=Automatically picks the single package from the repositories among several external ({}) available as the provider for a given dependency
|
||||
arch.config.refresh_mirrors=Refresh mirrors on startup
|
||||
arch.config.refresh_mirrors.tip=Refresh the package mirrors once a day on startup
|
||||
arch.config.repos=Repositories packages
|
||||
|
||||
@@ -72,6 +72,8 @@ arch.config.mirrors_sort_limit.tip=Define o número máximo de espelhos que ser
|
||||
arch.config.optimize=Otimizar {}
|
||||
arch.config.pacman_mthread_download=Download segmentado (repositórios)
|
||||
arch.config.pacman_mthread_download.tip=Se os pacotes dos repositórios devem baixados através de uma ferramenta que trabalha com segmentação/threads (pode ser mais rápido). pacman-mirrors precisa estar instalado.
|
||||
arch.config.prefer_repository_provider=Preferir dependências de repositórios
|
||||
arch.config.prefer_repository_provider.tip=Define automaticamente o pacote único proveniente dos repositórios entre diversos externos ({}) disponíveis como provedor de uma dependência
|
||||
arch.config.refresh_mirrors=Atualizar espelhos ao iniciar
|
||||
arch.config.refresh_mirrors.tip=Atualiza os espelhos de pacotes uma vez ao dia na inicialização
|
||||
arch.config.repos=Pacotes de repositórios
|
||||
|
||||
@@ -73,6 +73,8 @@ arch.config.optimize=Оптимизация {}
|
||||
arch.config.optimize.tip=Оптимизированные настройки будут использоваться для ускорения установки пакетов, в противном случае будут использоваться системные настройки
|
||||
arch.config.pacman_mthread_download=Multithreaded download (repositories)
|
||||
arch.config.pacman_mthread_download.tip=Whether the repository packages should be downloaded with a tool that works with threads (it may be faster). pacman-mirrors must be installed.
|
||||
arch.config.prefer_repository_provider=Prefer repository dependencies
|
||||
arch.config.prefer_repository_provider.tip=Automatically picks the single package from the repositories among several external ({}) available as the provider for a given dependency
|
||||
arch.config.refresh_mirrors=Обновить зеркала при запуске
|
||||
arch.config.refresh_mirrors.tip=Обновляйте зеркала пакета один раз в день при запуске
|
||||
arch.config.repos=Пакеты репозиториев
|
||||
|
||||
@@ -73,6 +73,8 @@ arch.config.optimize=Optimize {}
|
||||
arch.config.optimize.tip=Paketlerin kurulumunu, yükseltilmesini ve indirilmesini hızlandırmak için optimize edilmiş ayarlar kullanılacak, aksi takdirde sistem ayarları kullanılacak
|
||||
arch.config.pacman_mthread_download=Multithreaded download (repositories)
|
||||
arch.config.pacman_mthread_download.tip=Whether the repository packages should be downloaded with a tool that works with threads (it may be faster). pacman-mirrors must be installed.
|
||||
arch.config.prefer_repository_provider=Prefer repository dependencies
|
||||
arch.config.prefer_repository_provider.tip=Automatically picks the single package from the repositories among several external ({}) available as the provider for a given dependency
|
||||
arch.config.refresh_mirrors=Başlangıçta yansıları yenile
|
||||
arch.config.refresh_mirrors.tip=Paket yansılarını başlangıçta günde bir kez yenileyin
|
||||
arch.config.repos=Depo paketleri
|
||||
|
||||
@@ -227,7 +227,8 @@ class UpdatesSummarizer:
|
||||
remote_provided_map=context.remote_provided_map,
|
||||
remote_repo_map=context.remote_repo_map,
|
||||
watcher=self.watcher,
|
||||
automatch_providers=context.arch_config['automatch_providers'])
|
||||
automatch_providers=context.arch_config['automatch_providers'],
|
||||
prefer_repository_provider=context.arch_config['prefer_repository_provider'])
|
||||
|
||||
if deps is None:
|
||||
tf = time.time()
|
||||
|
||||
Reference in New Issue
Block a user