[arch] improvement -> new settings property 'aur_remove_build_dir'

This commit is contained in:
Vinicius Moreira
2020-08-20 11:55:37 -03:00
parent f632aea55e
commit 92384875cd
12 changed files with 35 additions and 9 deletions

View File

@@ -41,6 +41,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
<p align="center"> <p align="center">
<img src="https://raw.githubusercontent.com/vinifmor/bauh-files/master/pictures/releases/0.9.7/aur_buildir.png"> <img src="https://raw.githubusercontent.com/vinifmor/bauh-files/master/pictures/releases/0.9.7/aur_buildir.png">
</p> </p>
- new settings property **aur_remove_build_dir** -> it defines if a package's generated build directory should be removed after the operation is finished (installation, upgrading, ...). Default: true
- preventing a possible error when the optional deps of a given package cannot be found - preventing a possible error when the optional deps of a given package cannot be found
- Flatpak - Flatpak

View File

@@ -189,12 +189,13 @@ sync_databases_startup: true # package databases synchronization once a day dur
clean_cached: true # defines if old cached versions should be removed from the disk cache during a package uninstallation clean_cached: true # defines if old cached versions should be removed from the disk cache during a package uninstallation
refresh_mirrors_startup: false # if the package mirrors should be refreshed during startup refresh_mirrors_startup: false # if the package mirrors should be refreshed during startup
mirrors_sort_limit: 5 # defines the maximum number of mirrors that will be used for speed sorting. Use 0 for no limit or leave it blank to disable sorting. mirrors_sort_limit: 5 # defines the maximum number of mirrors that will be used for speed sorting. Use 0 for no limit or leave it blank to disable sorting.
aur: true # allows to manage AUR packages aur: true. Default: true # allows to manage AUR packages
repositories: true # allows to manage packages from the configured repositories repositories: true # allows to manage packages from the configured repositories. Default: true
repositories_mthread_download: false # enable multi-threaded download for repository packages if aria2/axel is installed repositories_mthread_download: false # enable multi-threaded download for repository packages if aria2/axel is installed (otherwise pacman will download the packages). Default: false
automatch_providers: true # if a possible provider for a given package dependency exactly matches its name, it will be chosen instead of asking for the user to decide (false). automatch_providers: true # if a possible provider for a given package dependency exactly matches its name, it will be chosen instead of asking for the user to decide (false). Default: true.
edit_aur_pkgbuild: false # if the AUR PKGBUILD file should be displayed for edition before the make process. true (PKGBUILD will always be displayed for edition), false (PKGBUILD never will be displayed), null (a popup will ask if the user want to edit the PKGBUILD) edit_aur_pkgbuild: false # if the AUR PKGBUILD file should be displayed for edition before the make process. true (PKGBUILD will always be displayed for edition), false (PKGBUILD never will be displayed), null (a popup will ask if the user want to edit the PKGBUILD). Default: false.
aur_build_dir: null # defines a custom build directory for AUR packages (a null value will point to /tmp/bauh/arch (non-root user) or /tmp/bauh_root/arch (root user)) aur_build_dir: null # defines a custom build directory for AUR packages (a null value will point to /tmp/bauh/arch (non-root user) or /tmp/bauh_root/arch (root user)). Default: null.
aur_remove_build_dir: true # it defines if a package's generated build directory should be removed after the operation is finished (installation, upgrading, ...). Options: true, false (default: true).
``` ```
- Required dependencies: - Required dependencies:
- **pacman** - **pacman**

View File

@@ -16,7 +16,8 @@ def read_config(update_file: bool = False) -> dict:
'repositories_mthread_download': False, 'repositories_mthread_download': False,
'automatch_providers': True, 'automatch_providers': True,
'edit_aur_pkgbuild': False, 'edit_aur_pkgbuild': False,
'aur_build_dir': None} 'aur_build_dir': None,
'aur_remove_build_dir': True}
return read(CONFIG_FILE, template, update_file=update_file) return read(CONFIG_FILE, template, update_file=update_file)

View File

@@ -642,7 +642,7 @@ class ArchManager(SoftwareManager):
return False return False
finally: finally:
if os.path.exists(context.build_dir): if os.path.exists(context.build_dir) and context.config['aur_remove_build_dir']:
context.handler.handle(SystemProcess(subproc=new_subprocess(['rm', '-rf', context.build_dir]))) context.handler.handle(SystemProcess(subproc=new_subprocess(['rm', '-rf', context.build_dir])))
return False return False
@@ -2150,7 +2150,7 @@ class ArchManager(SoftwareManager):
return self._build(context) return self._build(context)
finally: finally:
if os.path.exists(context.build_dir): if os.path.exists(context.build_dir) and context.config['aur_remove_build_dir']:
context.handler.handle(SystemProcess(new_subprocess(['rm', '-rf', context.build_dir]))) context.handler.handle(SystemProcess(new_subprocess(['rm', '-rf', context.build_dir])))
return False return False
@@ -2503,6 +2503,12 @@ class ArchManager(SoftwareManager):
max_width=max_width, max_width=max_width,
type_=SelectViewType.RADIO, type_=SelectViewType.RADIO,
capitalize_label=False), capitalize_label=False),
self._gen_bool_selector(id_='aur_remove_build_dir',
label_key='arch.config.aur_remove_build_dir',
tooltip_key='arch.config.aur_remove_build_dir.tip',
value=bool(local_config['aur_remove_build_dir']),
max_width=max_width,
capitalize_label=False),
FileChooserComponent(id_='aur_build_dir', FileChooserComponent(id_='aur_build_dir',
label=self.i18n['arch.config.aur_build_dir'], label=self.i18n['arch.config.aur_build_dir'],
tooltip=self.i18n['arch.config.aur_build_dir.tip'].format(BUILD_DIR), tooltip=self.i18n['arch.config.aur_build_dir.tip'].format(BUILD_DIR),
@@ -2529,6 +2535,7 @@ class ArchManager(SoftwareManager):
config['repositories_mthread_download'] = form_install.get_component('mthread_download').get_selected() config['repositories_mthread_download'] = form_install.get_component('mthread_download').get_selected()
config['automatch_providers'] = form_install.get_component('autoprovs').get_selected() config['automatch_providers'] = form_install.get_component('autoprovs').get_selected()
config['edit_aur_pkgbuild'] = form_install.get_component('edit_aur_pkgbuild').get_selected() config['edit_aur_pkgbuild'] = form_install.get_component('edit_aur_pkgbuild').get_selected()
config['aur_remove_build_dir'] = form_install.get_component('aur_remove_build_dir').get_selected()
config['aur_build_dir'] = form_install.get_component('aur_build_dir').file_path config['aur_build_dir'] = form_install.get_component('aur_build_dir').file_path
if not config['aur_build_dir']: if not config['aur_build_dir']:

View File

@@ -32,6 +32,8 @@ 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.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) arch.config.aur_build_dir=Build directory (AUR)
arch.config.aur_build_dir.tip=It define a custom directory where the AUR packages will be built. Default: {}. arch.config.aur_build_dir.tip=It define a custom directory where the AUR packages will be built. Default: {}.
arch.config.aur_remove_build_dir=Remove build directory (AUR)
arch.config.aur_remove_build_dir.tip=If a package's generated build directory should be removed after the operations is finished.
arch.config.clean_cache=Elimina les versions antigues arch.config.clean_cache=Elimina les versions antigues
arch.config.clean_cache.tip=Si cal eliminar les versions antigues d'un paquet emmagatzemat al disc durant la desinstal·lació arch.config.clean_cache.tip=Si cal eliminar les versions antigues d'un paquet emmagatzemat al disc durant la desinstal·lació
arch.config.edit_aur_pkgbuild=Edit PKGBUILD (AUR) arch.config.edit_aur_pkgbuild=Edit PKGBUILD (AUR)

View File

@@ -32,6 +32,8 @@ 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.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) arch.config.aur_build_dir=Build directory (AUR)
arch.config.aur_build_dir.tip=It define a custom directory where the AUR packages will be built. Default: {}. arch.config.aur_build_dir.tip=It define a custom directory where the AUR packages will be built. Default: {}.
arch.config.aur_remove_build_dir=Remove build directory (AUR)
arch.config.aur_remove_build_dir.tip=If a package's generated build directory should be removed after the operations is finished.
arch.config.clean_cache=Remove old versions arch.config.clean_cache=Remove old versions
arch.config.clean_cache.tip=Whether old versions of a package stored on disk should be removed during uninstall arch.config.clean_cache.tip=Whether old versions of a package stored on disk should be removed during uninstall
arch.config.edit_aur_pkgbuild=Edit PKGBUILD (AUR) arch.config.edit_aur_pkgbuild=Edit PKGBUILD (AUR)

View File

@@ -33,6 +33,8 @@ 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.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) arch.config.aur_build_dir=Build directory (AUR)
arch.config.aur_build_dir.tip=It define a custom directory where the AUR packages will be built. Default: {}. arch.config.aur_build_dir.tip=It define a custom directory where the AUR packages will be built. Default: {}.
arch.config.aur_remove_build_dir=Remove build directory (AUR)
arch.config.aur_remove_build_dir.tip=If a package's generated build directory should be removed after the operations is finished.
arch.config.clean_cache=Remove old versions arch.config.clean_cache=Remove old versions
arch.config.clean_cache.tip=Whether old versions of a package stored on disk should be removed during uninstall arch.config.clean_cache.tip=Whether old versions of a package stored on disk should be removed during uninstall
arch.config.edit_aur_pkgbuild=Edit PKGBUILD (AUR) arch.config.edit_aur_pkgbuild=Edit PKGBUILD (AUR)

View File

@@ -32,6 +32,8 @@ 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.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) arch.config.aur_build_dir=Directorio de compilación (AUR)
arch.config.aur_build_dir.tip=Define un directorio personalizado donde se construirán los paquetes AUR. Defecto: {}. arch.config.aur_build_dir.tip=Define un directorio personalizado donde se construirán los paquetes AUR. Defecto: {}.
arch.config.aur_remove_build_dir=Eliminar directorio de compilación (AUR)
arch.config.aur_remove_build_dir.tip=Si el directorio de compilación generado para un paquete debe ser eliminado una vez finalizada la operación.
arch.config.clean_cache=Eliminar versiones antiguas arch.config.clean_cache=Eliminar versiones antiguas
arch.config.clean_cache.tip=Si las versiones antiguas de un paquete almacenado en el disco deben ser eliminadas durante la desinstalación arch.config.clean_cache.tip=Si las versiones antiguas de un paquete almacenado en el disco deben ser eliminadas durante la desinstalación
arch.config.edit_aur_pkgbuild=Editar PKGBUILD (AUR) arch.config.edit_aur_pkgbuild=Editar PKGBUILD (AUR)

View File

@@ -32,6 +32,8 @@ 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.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) arch.config.aur_build_dir=Build directory (AUR)
arch.config.aur_build_dir.tip=It define a custom directory where the AUR packages will be built. Default: {}. arch.config.aur_build_dir.tip=It define a custom directory where the AUR packages will be built. Default: {}.
arch.config.aur_remove_build_dir=Remove build directory (AUR)
arch.config.aur_remove_build_dir.tip=If a package's generated build directory should be removed after the operations is finished.
arch.config.clean_cache=Rimuovi le vecchie versioni arch.config.clean_cache=Rimuovi le vecchie versioni
arch.config.clean_cache.tip=Se le vecchie versioni di un pacchetto memorizzate sul disco devono essere rimosse durante la disinstallazione arch.config.clean_cache.tip=Se le vecchie versioni di un pacchetto memorizzate sul disco devono essere rimosse durante la disinstallazione
arch.config.edit_aur_pkgbuild=Edit PKGBUILD (AUR) arch.config.edit_aur_pkgbuild=Edit PKGBUILD (AUR)

View File

@@ -33,6 +33,8 @@ 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.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) arch.config.aur_build_dir=Diretório de construção (AUR)
arch.config.aur_build_dir.tip=Define um diretório personalizado onde pacotes do AUR serão construídos. Padrão: {}. arch.config.aur_build_dir.tip=Define um diretório personalizado onde pacotes do AUR serão construídos. Padrão: {}.
arch.config.aur_remove_build_dir=Remover diretório de construção (AUR)
arch.config.aur_remove_build_dir.tip=Se o diretório gerado para a construção de um pacote do AUR deve ser removido após a operação ser finalizada.
arch.config.clean_cache=Remover versões antigas arch.config.clean_cache=Remover versões antigas
arch.config.clean_cache.tip=Se versões antigas de um pacote armazenadas em disco devem ser removidas durante a desinstalação arch.config.clean_cache.tip=Se versões antigas de um pacote armazenadas em disco devem ser removidas durante a desinstalação
arch.config.edit_aur_pkgbuild=Editar PKGBUILD (AUR) arch.config.edit_aur_pkgbuild=Editar PKGBUILD (AUR)

View File

@@ -32,6 +32,8 @@ 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.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) arch.config.aur_build_dir=Build directory (AUR)
arch.config.aur_build_dir.tip=It define a custom directory where the AUR packages will be built. Default: {}. arch.config.aur_build_dir.tip=It define a custom directory where the AUR packages will be built. Default: {}.
arch.config.aur_remove_build_dir=Remove build directory (AUR)
arch.config.aur_remove_build_dir.tip=If a package's generated build directory should be removed after the operations is finished.
arch.config.clean_cache=Remove old versions arch.config.clean_cache=Remove old versions
arch.config.clean_cache.tip=Whether old versions of a package stored on disk should be removed during uninstall arch.config.clean_cache.tip=Whether old versions of a package stored on disk should be removed during uninstall
arch.config.edit_aur_pkgbuild=Edit PKGBUILD (AUR) arch.config.edit_aur_pkgbuild=Edit PKGBUILD (AUR)

View File

@@ -32,6 +32,8 @@ 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.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) arch.config.aur_build_dir=Build directory (AUR)
arch.config.aur_build_dir.tip=It define a custom directory where the AUR packages will be built. Default: {}. arch.config.aur_build_dir.tip=It define a custom directory where the AUR packages will be built. Default: {}.
arch.config.aur_remove_build_dir=Remove build directory (AUR)
arch.config.aur_remove_build_dir.tip=If a package's generated build directory should be removed after the operations is finished.
arch.config.clean_cache=Önbelleği temizle arch.config.clean_cache=Önbelleği temizle
arch.config.clean_cache.tip=Disk üzerinde kurulu bir paketin eski sürümlerinin kaldırma sırasında kaldırılıp kaldırılmayacağı arch.config.clean_cache.tip=Disk üzerinde kurulu bir paketin eski sürümlerinin kaldırma sırasında kaldırılıp kaldırılmayacağı
arch.config.edit_aur_pkgbuild=Edit PKGBUILD (AUR) arch.config.edit_aur_pkgbuild=Edit PKGBUILD (AUR)