mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 01:14:15 +02:00
[improvement][aur] showing a warning messaging when trying to install / update a package with the root user
This commit is contained in:
@@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
- checking architecture dependencies (x86_64, i686)
|
||||
- architecture dependencies are displayed on the info window as well
|
||||
- optimizations to speed up zst packages building
|
||||
- showing a warning messaging when trying to install / update a package with the root user
|
||||
- UI:
|
||||
- **Settings** available as a tray action as well
|
||||
- minor improvements
|
||||
|
||||
@@ -21,6 +21,7 @@ from bauh.api.abstract.model import PackageUpdate, PackageHistory, SoftwarePacka
|
||||
from bauh.api.abstract.view import MessageType, FormComponent, InputOption, SingleSelectComponent, SelectViewType, \
|
||||
ViewComponent, PanelComponent
|
||||
from bauh.api.constants import TEMP_DIR
|
||||
from bauh.commons import user
|
||||
from bauh.commons.category import CategoriesDownloader
|
||||
from bauh.commons.config import save_config
|
||||
from bauh.commons.html import bold
|
||||
@@ -262,6 +263,12 @@ class ArchManager(SoftwareManager):
|
||||
shutil.rmtree(pkg.get_disk_cache_path())
|
||||
|
||||
def update(self, pkg: ArchPackage, root_password: str, watcher: ProcessWatcher) -> bool:
|
||||
if user.is_root() and pkg.mirror == 'aur':
|
||||
watcher.show_message(title=self.i18n['arch.install.aur.root_error.title'],
|
||||
body=self.i18n['arch.install.aur.root_error.body'],
|
||||
type_=MessageType.ERROR)
|
||||
return False
|
||||
|
||||
self.local_config = read_config()
|
||||
try:
|
||||
return self.install(pkg=pkg, root_password=root_password, watcher=watcher, skip_optdeps=True)
|
||||
@@ -893,6 +900,12 @@ class ArchManager(SoftwareManager):
|
||||
ArchCompilationOptimizer(self.context.logger).optimize()
|
||||
|
||||
def install(self, pkg: ArchPackage, root_password: str, watcher: ProcessWatcher, skip_optdeps: bool = False) -> bool:
|
||||
if user.is_root() and pkg.mirror == 'aur':
|
||||
watcher.show_message(title=self.i18n['arch.install.aur.root_error.title'],
|
||||
body=self.i18n['arch.install.aur.root_error.body'],
|
||||
type_=MessageType.ERROR)
|
||||
return False
|
||||
|
||||
clean_config = False
|
||||
|
||||
if not self.local_config:
|
||||
|
||||
@@ -112,4 +112,6 @@ arch.sync_databases.substatus.error=It was not possible to synchronize the packa
|
||||
arch.config.sync_dbs=Synchronize packages databases
|
||||
arch.config.sync_dbs.tip=Synchronizes the package databases once a day ( or after a device reboot ) before the first package installation, upgrade or downgrade. This option help to prevent errors during these operations.
|
||||
arch.config.simple_dep_check=Verificació de dependències simples
|
||||
arch.config.simple_dep_check.tip=Si només s'hauria d'utilitzar la verificació de dependència proporcionada per pacman abans d'instal·lar un paquet (més ràpid, però no sempre exacte). Si està desactivat, es farà una comprovació més completa (més lenta, però més precisa)
|
||||
arch.config.simple_dep_check.tip=Si només s'hauria d'utilitzar la verificació de dependència proporcionada per pacman abans d'instal·lar un paquet (més ràpid, però no sempre exacte). Si està desactivat, es farà una comprovació més completa (més lenta, però més precisa)
|
||||
arch.install.aur.root_error.title=No es permet l’acció
|
||||
arch.install.aur.root_error.body=La instal·lació o actualització de paquets com a root no està permesa
|
||||
@@ -112,4 +112,6 @@ arch.sync_databases.substatus.error=It was not possible to synchronize the packa
|
||||
arch.config.sync_dbs=Synchronize packages databases
|
||||
arch.config.sync_dbs.tip=Synchronizes the package databases once a day ( or after a device reboot ) before the first package installation, upgrade or downgrade. This option help to prevent errors during these operations.
|
||||
arch.config.simple_dep_check=Simple dependencies checking
|
||||
arch.config.simple_dep_check.tip=If only the dependency checking provided by pacman should be used before installing a package ( faster, but not always accurate ). If disabled, a more complete checking will be performed ( slower, but more accurate )
|
||||
arch.config.simple_dep_check.tip=If only the dependency checking provided by pacman should be used before installing a package ( faster, but not always accurate ). If disabled, a more complete checking will be performed ( slower, but more accurate )
|
||||
arch.install.aur.root_error.title=Action not allowed
|
||||
arch.install.aur.root_error.body=Installing or updating packages as root is not allowed
|
||||
@@ -112,4 +112,6 @@ arch.sync_databases.substatus.error=It was not possible to synchronize the packa
|
||||
arch.config.sync_dbs=Synchronize packages databases
|
||||
arch.config.sync_dbs.tip=Synchronizes the package databases once a day ( or after a device reboot ) before the first package installation, upgrade or downgrade. This option help to prevent errors during these operations.
|
||||
arch.config.simple_dep_check=Simple dependencies checking
|
||||
arch.config.simple_dep_check.tip=If only the dependency checking provided by pacman should be used before installing a package ( faster, but not always accurate ). If disabled, a more complete checking will be performed ( slower, but more accurate )
|
||||
arch.config.simple_dep_check.tip=If only the dependency checking provided by pacman should be used before installing a package ( faster, but not always accurate ). If disabled, a more complete checking will be performed ( slower, but more accurate )
|
||||
arch.install.aur.root_error.title=Action not allowed
|
||||
arch.install.aur.root_error.body=Installing or updating packages as root is not allowed
|
||||
@@ -112,4 +112,6 @@ arch.sync_databases.substatus.error=No fue posible sincronizar la base de paquet
|
||||
arch.config.sync_dbs=Sincronizar las bases de paquetes
|
||||
arch.config.sync_dbs.tip=Sincroniza las bases de paquetes una vez al día ( o cada reinicialización del dispositivo ) antes de la primera instalación, actualización o reversión de un paquete. Esta opción ayuda a prevenir errores durante estas operaciones.
|
||||
arch.config.simple_dep_check=Verificación de dependencias simples
|
||||
arch.config.simple_dep_check.tip=Si solo se usara la verificación de dependencia provista por pacman antes de instalar un paquete (más rápido, pero no siempre exacto). Si está deshabilitado, se realizará una verificación más completa (más lenta, pero más precisa)
|
||||
arch.config.simple_dep_check.tip=Si solo se usara la verificación de dependencia provista por pacman antes de instalar un paquete (más rápido, pero no siempre exacto). Si está deshabilitado, se realizará una verificación más completa (más lenta, pero más precisa)
|
||||
arch.install.aur.root_error.title=Acción no permitida
|
||||
arch.install.aur.root_error.body=Instalar o actualizar paquetes como root no es permitido
|
||||
@@ -80,4 +80,6 @@ arch.sync_databases.substatus.error=It was not possible to synchronize the packa
|
||||
arch.config.sync_dbs=Synchronize packages databases
|
||||
arch.config.sync_dbs.tip=Synchronizes the package databases once a day ( or after a device reboot ) before the first package installation, upgrade or downgrade. This option help to prevent errors during these operations.
|
||||
arch.config.simple_dep_check=Verifica delle dipendenze semplice
|
||||
arch.config.simple_dep_check.tip=Se è necessario utilizzare solo la verifica della dipendenza fornita da pacman prima di installare un pacchetto (più veloce, ma non sempre accurato). Se disabilitato, verrà eseguito un controllo più completo (più lento, ma più accurato)
|
||||
arch.config.simple_dep_check.tip=Se è necessario utilizzare solo la verifica della dipendenza fornita da pacman prima di installare un pacchetto (più veloce, ma non sempre accurato). Se disabilitato, verrà eseguito un controllo più completo (più lento, ma più accurato)
|
||||
arch.install.aur.root_error.title=Azione non consentita
|
||||
arch.install.aur.root_error.body=L'installazione o l'aggiornamento di pacchetti come root non è consentito
|
||||
@@ -113,3 +113,5 @@ arch.config.sync_dbs=Sincronizar bases de pacotes
|
||||
arch.config.sync_dbs.tip=Sincroniza as bases de pacotes uma vez ao dia ( ou a cada reinicialização do dispositivo ) antes da primeira instalação, atualização ou reversão de um pacote. Essa opção ajuda a evitar erros durante essa operações.
|
||||
arch.config.simple_dep_check=Verificação de dependências simples
|
||||
arch.config.simple_dep_check.tip=Se somente a verificação de dependências provida pelo pacman deve ser usada antes de instalar um pacote ( mais rápida, porém nem sempre precisa ). Se desativada, uma verificação mais completa será realizada ( mais lenta, porém mais precisa )
|
||||
arch.install.aur.root_error.title=Ação não permitida
|
||||
arch.install.aur.root_error.body=Não é permitido instalar ou atualizar pacotes como usuário root
|
||||
Reference in New Issue
Block a user