diff --git a/CHANGELOG.md b/CHANGELOG.md index 6eb1fd66..3ec85914 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Features - Arch - AUR: - - [rebuild-detector](https://github.com/maximbaz/rebuild-detector) integration + - [rebuild-detector](https://github.com/maximbaz/rebuild-detector) integration [#139](https://github.com/vinifmor/bauh/issues/139) - if a package needs to be rebuilt, it will be marked for update (rebuild-detector must be installed on your system, but it is not a hard requirement). - if you hold the mouse over the package 'version' the message "The package needs to be reinstalled" will be displayed. - this integration can be controlled though the new settings property **aur_rebuild_detector** (default: true). @@ -25,6 +25,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

+ - new settings property **aur_rebuild_detector_no_bin** to ignore binary packages when checking with rebuild-detector (e.g: package-bin ). Default: true +

+ +

+ - new custom action to quickly reinstall a package

diff --git a/bauh/api/abstract/view.py b/bauh/api/abstract/view.py index 4050fe90..d9155c6f 100644 --- a/bauh/api/abstract/view.py +++ b/bauh/api/abstract/view.py @@ -218,6 +218,14 @@ class FormComponent(ViewComponent): raise Exception("'{}' is not a {}".format(id_, SingleSelectComponent.__class__.__name__)) return comp + def get_form_component(self, id_: str) -> Optional["FormComponent"]: + comp = self.get_component(id_) + + if comp: + if not isinstance(comp, FormComponent): + raise Exception("'{}' is not a {}".format(id_, FormComponent.__class__.__name__)) + return comp + class FileChooserComponent(ViewComponent): diff --git a/bauh/gems/arch/config.py b/bauh/gems/arch/config.py index 29b6340d..d1261f83 100644 --- a/bauh/gems/arch/config.py +++ b/bauh/gems/arch/config.py @@ -39,4 +39,5 @@ class ArchConfigManager(YAMLConfigManager): 'suggest_optdep_uninstall': False, 'aur_idx_exp': 1, 'categories_exp': 24, - 'aur_rebuild_detector': True} + 'aur_rebuild_detector': True, + "aur_rebuild_detector_no_bin": True} diff --git a/bauh/gems/arch/controller.py b/bauh/gems/arch/controller.py index 8209a33a..fa1c48db 100644 --- a/bauh/gems/arch/controller.py +++ b/bauh/gems/arch/controller.py @@ -62,6 +62,7 @@ RE_PRE_DOWNLOAD_BL_EXT = re.compile(r'.+\.(git|gpg)$') RE_PKGBUILD_PKGNAME = re.compile(r'pkgname\s*=.+') RE_CONFLICT_DETECTED = re.compile(r'\n::\s*(.+)\s+are in conflict\s*.') RE_DEPENDENCY_BREAKAGE = re.compile(r'\n?::\s+installing\s+(.+\s\(.+\))\sbreaks\sdependency\s\'(.+)\'\srequired\sby\s(.+)\s*', flags=re.IGNORECASE) +RE_PKG_ENDS_WITH_BIN = re.compile(r'.+[\-_]bin$') class TransactionContext: @@ -581,10 +582,14 @@ class ArchManager(SoftwareManager): self.disk_cache_updater.join() self.logger.info("Disk cache ready") - def __fill_packages_to_rebuild(self, output: Dict[str, Set[str]]): + def __fill_packages_to_rebuild(self, output: Dict[str, Set[str]], ignore_binaries: bool): if rebuild_detector.is_installed(): self.logger.info("rebuild-detector: checking") to_rebuild = rebuild_detector.list_required_rebuild() + + if to_rebuild and ignore_binaries: + to_rebuild = {p for p in to_rebuild if not RE_PKG_ENDS_WITH_BIN.match(p)} + output['to_rebuild'].update(to_rebuild) self.logger.info("rebuild-detector: {} packages require rebuild".format(len(to_rebuild))) @@ -603,7 +608,9 @@ class ArchManager(SoftwareManager): rebuild_output, rebuild_check, rebuild_ignored = None, None, None if aur_supported and arch_config['aur_rebuild_detector']: rebuild_output = {'to_rebuild': set(), 'ignored': set()} - rebuild_check = Thread(target=self.__fill_packages_to_rebuild, args=(rebuild_output,), daemon=True) + rebuild_check = Thread(target=self.__fill_packages_to_rebuild, + args=(rebuild_output, arch_config['aur_rebuild_detector_no_bin']), + daemon=True) rebuild_check.start() rebuild_ignored = Thread(target=self.__fill_ignored_by_rebuild_detector, args=(rebuild_output, ), daemon=True) @@ -2853,6 +2860,14 @@ class ArchManager(SoftwareManager): tooltip_params=["'rebuild-detector'"], capitalize_label=False, max_width=max_width), + self._gen_bool_selector(id_='rebuild_detector_no_bin', + label_key='arch.config.aur_rebuild_detector_no_bin', + label_params=['rebuild-detector'], + tooltip_key='arch.config.aur_rebuild_detector_no_bin.tip', + tooltip_params=['rebuild-detector', self.i18n['arch.config.aur_rebuild_detector'].format('')], + value=bool(arch_config['aur_rebuild_detector_no_bin']), + capitalize_label=False, + max_width=max_width), self._gen_bool_selector(id_='autoprovs', label_key='arch.config.automatch_providers', tooltip_key='arch.config.automatch_providers.tip', @@ -2962,6 +2977,7 @@ class ArchManager(SoftwareManager): arch_config['repositories'] = form.get_single_select_component('repos').get_selected() arch_config['optimize'] = form.get_single_select_component('opts').get_selected() arch_config['aur_rebuild_detector'] = form.get_single_select_component('rebuild_detector').get_selected() + arch_config['aur_rebuild_detector_no_bin'] = form.get_single_select_component('rebuild_detector_no_bin').get_selected() arch_config['sync_databases'] = form.get_single_select_component('sync_dbs').get_selected() arch_config['sync_databases_startup'] = form.get_single_select_component('sync_dbs_start').get_selected() arch_config['clean_cached'] = form.get_single_select_component('clean_cached').get_selected() diff --git a/bauh/gems/arch/resources/locale/ca b/bauh/gems/arch/resources/locale/ca index 61f5b388..29ae0f2c 100644 --- a/bauh/gems/arch/resources/locale/ca +++ b/bauh/gems/arch/resources/locale/ca @@ -46,6 +46,8 @@ arch.config.aur=AUR packages arch.config.aur.tip=It allows to manage AUR packages. git must be installed. arch.config.aur_rebuild_detector=Check reinstallation need {} arch.config.aur_rebuild_detector.tip=It checks if packages built with old library versions require to be rebuilt. If a package needs to be rebuilt, it will be marked for update ({} must be installed) +arch.config.aur_rebuild_detector_no_bin=Ignore binaries ({}) +arch.config.aur_rebuild_detector_no_bin.tip=If binary packages named as "package-bin" should be ignored by {} ({}) arch.config.automatch_providers=Auto-define dependency providers arch.config.automatch_providers.tip=It automatically chooses which provider will be used for a package dependency when both names are equal. arch.config.aur_build_dir=Build directory (AUR) diff --git a/bauh/gems/arch/resources/locale/de b/bauh/gems/arch/resources/locale/de index d9d3f46d..e5a30ae0 100644 --- a/bauh/gems/arch/resources/locale/de +++ b/bauh/gems/arch/resources/locale/de @@ -46,6 +46,8 @@ arch.config.aur=AUR packages arch.config.aur.tip=It allows to manage AUR packages. git must be installed. arch.config.aur_rebuild_detector=Check reinstallation need {} arch.config.aur_rebuild_detector.tip=It checks if packages built with old library versions require to be rebuilt. If a package needs to be rebuilt, it will be marked for update ({} must be installed) +arch.config.aur_rebuild_detector_no_bin=Ignore binaries ({}) +arch.config.aur_rebuild_detector_no_bin.tip=If binary packages named as "package-bin" should be ignored by {} ({}) arch.config.automatch_providers=Auto-define dependency providers arch.config.automatch_providers.tip=It automatically chooses which provider will be used for a package dependency when both names are equal. arch.config.aur_build_dir=Build directory (AUR) diff --git a/bauh/gems/arch/resources/locale/en b/bauh/gems/arch/resources/locale/en index c9bf4b82..6401202a 100644 --- a/bauh/gems/arch/resources/locale/en +++ b/bauh/gems/arch/resources/locale/en @@ -46,6 +46,8 @@ arch.config.aur=AUR packages arch.config.aur.tip=It allows to manage AUR packages. git must be installed. arch.config.aur_rebuild_detector=Check reinstallation need {} arch.config.aur_rebuild_detector.tip=It checks if packages built with old library versions require to be rebuilt. If a package needs to be rebuilt, it will be marked for update ({} must be installed) +arch.config.aur_rebuild_detector_no_bin=Ignore binaries ({}) +arch.config.aur_rebuild_detector_no_bin.tip=If binary packages named as "package-bin" should be ignored by {} ({}) arch.config.automatch_providers=Auto-define dependency providers arch.config.automatch_providers.tip=It automatically chooses which provider will be used for a package dependency when both names are equal. arch.config.aur_build_dir=Build directory (AUR) diff --git a/bauh/gems/arch/resources/locale/es b/bauh/gems/arch/resources/locale/es index 53833a8b..20f7dfde 100644 --- a/bauh/gems/arch/resources/locale/es +++ b/bauh/gems/arch/resources/locale/es @@ -46,6 +46,8 @@ arch.config.aur=Paquetes de AUR arch.config.aur.tip=Permite gestionar paquetes del AUR. git debe estar instalado. arch.config.aur_rebuild_detector=Verificar necesidad de reinstalación {} arch.config.aur_rebuild_detector.tip=Verifica si los paquetes creados con versiones antiguas de bibliotecas necesitan ser reconstruidos. Si es necesario reconstruir un paquete, el será marcado para actualización ({} debe estar instalado) +arch.config.aur_rebuild_detector_no_bin=Ignorar binarios ({}) +arch.config.aur_rebuild_detector_no_bin.tip=Si los paquetes binarios nombrados como "paquete-bin" deben ser ignorados por {} ({}) arch.config.automatch_providers=Autodefinir proveedores de dependencia arch.config.automatch_providers.tip=Elige automáticamente qué proveedor se usará para una dependencia de paquete cuando ambos nombres son iguales. arch.config.aur_build_dir=Directorio de compilación (AUR) diff --git a/bauh/gems/arch/resources/locale/fr b/bauh/gems/arch/resources/locale/fr index 582823f8..b779f65a 100644 --- a/bauh/gems/arch/resources/locale/fr +++ b/bauh/gems/arch/resources/locale/fr @@ -46,6 +46,8 @@ arch.config.aur=Paquêts AUR arch.config.aur.tip=Permet la gestion des paquets AUR. git doit être installé. arch.config.aur_rebuild_detector=Check reinstallation need {} arch.config.aur_rebuild_detector.tip=It checks if packages built with old library versions require to be rebuilt. If a package needs to be rebuilt, it will be marked for update ({} must be installed) +arch.config.aur_rebuild_detector_no_bin=Ignore binaries ({}) +arch.config.aur_rebuild_detector_no_bin.tip=If binary packages named as "package-bin" should be ignored by {} ({}) arch.config.automatch_providers=Définition automatique des fournisseurs de dépendances arch.config.automatch_providers.tip=Choisit automatiquement le fournisseur de dépendances d'un paquet en cas de noms identiques arch.config.aur_build_dir=Répertoire de compilation (AUR) diff --git a/bauh/gems/arch/resources/locale/it b/bauh/gems/arch/resources/locale/it index a33825b6..442a25d8 100644 --- a/bauh/gems/arch/resources/locale/it +++ b/bauh/gems/arch/resources/locale/it @@ -46,6 +46,8 @@ arch.config.aur=AUR packages arch.config.aur.tip=It allows to manage AUR packages. git must be installed. arch.config.aur_rebuild_detector=Check reinstallation need {} arch.config.aur_rebuild_detector.tip=It checks if packages built with old library versions require to be rebuilt. If a package needs to be rebuilt, it will be marked for update ({} must be installed) +arch.config.aur_rebuild_detector_no_bin=Ignore binaries ({}) +arch.config.aur_rebuild_detector_no_bin.tip=If binary packages named as "package-bin" should be ignored by {} ({}) arch.config.automatch_providers=Auto-define dependency providers arch.config.automatch_providers.tip=It automatically chooses which provider will be used for a package dependency when both names are equal. arch.config.aur_build_dir=Build directory (AUR) diff --git a/bauh/gems/arch/resources/locale/pt b/bauh/gems/arch/resources/locale/pt index f91518dd..2b7f1402 100644 --- a/bauh/gems/arch/resources/locale/pt +++ b/bauh/gems/arch/resources/locale/pt @@ -45,7 +45,9 @@ arch.category.remove_from_aur=Removido do AUR arch.config.aur=Pacotes do AUR arch.config.aur.tip=Permite gerenciar pacotes dos AUR. git precisa estar instalado. arch.config.aur_rebuild_detector=Verificar necessidade de reinstalação {} -arch.config.aur_rebuild_detector.tip=Verifica se pacotes construídos com versões antigas de bibliotecas precisam ser reconstruídas.Se um pacote precisa ser reconstruído, ele será marcado para atualizar ({} precisa estar instalado). +arch.config.aur_rebuild_detector.tip=Verifica se pacotes construídos com versões antigas de bibliotecas precisam ser reconstruídas. Se um pacote precisa ser reconstruído, ele será marcado para atualizar ({} precisa estar instalado). +arch.config.aur_rebuild_detector_no_bin=Ignorar binários ({}) +arch.config.aur_rebuild_detector_no_bin.tip=Se pacotes binários nomeados como "pacote-bin" devem ser ignorados pelo {} ({}) arch.config.automatch_providers=Auto-definir provedores de dependências arch.config.automatch_providers.tip=Escolhe automaticamente qual provedor será utilizado para determinada dependência de um pacote caso os nomes de ambos sejam iguais. arch.config.aur_build_dir=Diretório de construção (AUR) diff --git a/bauh/gems/arch/resources/locale/ru b/bauh/gems/arch/resources/locale/ru index 30e86994..78098486 100644 --- a/bauh/gems/arch/resources/locale/ru +++ b/bauh/gems/arch/resources/locale/ru @@ -46,6 +46,8 @@ arch.config.aur=пакеты AUR arch.config.aur.tip=Это позволяет управлять пакетами AUR. git должен быть установлен. arch.config.aur_rebuild_detector=Check reinstallation need {} arch.config.aur_rebuild_detector.tip=It checks if packages built with old library versions require to be rebuilt. If a package needs to be rebuilt, it will be marked for update ({} must be installed) +arch.config.aur_rebuild_detector_no_bin=Ignore binaries ({}) +arch.config.aur_rebuild_detector_no_bin.tip=If binary packages named as "package-bin" should be ignored by {} ({}) arch.config.automatch_providers=Auto-define dependency providers arch.config.automatch_providers.tip=It automatically chooses which provider will be used for a package dependency when both names are equal. arch.config.aur_build_dir=Build directory (AUR) diff --git a/bauh/gems/arch/resources/locale/tr b/bauh/gems/arch/resources/locale/tr index 9937a22a..ffe30afb 100644 --- a/bauh/gems/arch/resources/locale/tr +++ b/bauh/gems/arch/resources/locale/tr @@ -46,6 +46,8 @@ arch.config.aur=AUR paketleri arch.config.aur.tip=AUR paketlerinin yönetilmesine izin verir. git yüklenmeli. arch.config.aur_rebuild_detector=Check reinstallation need {} arch.config.aur_rebuild_detector.tip=It checks if packages built with old library versions require to be rebuilt. If a package needs to be rebuilt, it will be marked for update ({} must be installed) +arch.config.aur_rebuild_detector_no_bin=Ignore binaries ({}) +arch.config.aur_rebuild_detector_no_bin.tip=If binary packages named as "package-bin" should be ignored by {} ({}) arch.config.automatch_providers=Auto-define dependency providers arch.config.automatch_providers.tip=It automatically chooses which provider will be used for a package dependency when both names are equal. arch.config.aur_build_dir=Build directory (AUR)