From baf85d1be1854326247666ef2571acca4cd3a94f Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Mon, 30 Sep 2019 10:45:09 -0300 Subject: [PATCH] Installed files of AUR packages available in the Info window --- CHANGELOG.md | 1 + README.md | 6 ++---- bauh/gems/arch/controller.py | 4 +++- bauh/gems/arch/pacman.py | 15 +++++++++++++++ bauh/gems/arch/resources/locale/en | 2 ++ bauh/gems/arch/resources/locale/es | 2 ++ bauh/gems/arch/resources/locale/pt | 2 ++ 7 files changed, 27 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f8edf3d7..5ce1a948 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [0.6.2] 2019-09- ### Improvements +- Installed files of AUR packages available in the Info window - Update notifications showing the number of updates by type as well - Improving Arch distro checking diff --git a/README.md b/README.md index fdb561ed..ac06fdcf 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,9 @@ -## bauh - **bauh** ( ba-oo ) is a graphical user interface to manage your Linux applications ( packages ) ( old **fpakman** ). It currently supports Flatpak, Snap and AUR packaging types. When you launch **bauh** you will see a management panel where you can search, update, install, uninstall and launch applications. You can also downgrade some applications depending on the package technology. It has a **tray mode** (see **Settings** below) that attaches the application icon to the system tray providing a quick way to launch it. Also the icon will get red when updates are available. -This project has an official Twitter account ( **@bauh4linux**) so people can stay on top of its news. +This project has an official Twitter account ( **@bauh4linux** ) so people can stay on top of its news. ### Developed with: - Python3 and Qt5. @@ -94,7 +92,7 @@ You can change some application settings via environment variables or arguments - It is **not enabled by default** - The user is able to search, install, uninstall, downgrade, launch and retrieve the packages history - It handles conflicts, and missing / optional packages installations ( including from your distro mirrors ) -- If (**aria2**) [https://github.com/aria2/aria2] is installed on your system and multi-threaded downloads are enabled ( see **BAUH_DOWNLOAD_MULTITHREAD** ), the source packages +- If [**aria2**](https://github.com/aria2/aria2) is installed on your system and multi-threaded downloads are enabled ( see **BAUH_DOWNLOAD_MULTITHREAD** ), the source packages will be pre-downloaded faster ( it does **NOT** modify your **pacman** settings ). - Automatically makes simple package compilation improvements diff --git a/bauh/gems/arch/controller.py b/bauh/gems/arch/controller.py index 5b37cb72..bdea15d1 100644 --- a/bauh/gems/arch/controller.py +++ b/bauh/gems/arch/controller.py @@ -270,6 +270,8 @@ class ArchManager(SoftwareManager): if pkg.pkgbuild: info['13_pkg_build'] = pkg.pkgbuild + info['14_installed_files'] = pacman.list_installed_files(pkg.name) + return info else: info = { @@ -295,7 +297,7 @@ class ArchManager(SoftwareManager): info['12_optdepends'] = srcinfo['optdepends'] if pkg.pkgbuild: - info['13_pkg_build'] = pkg.pkgbuild + info['00_pkg_build'] = pkg.pkgbuild else: info['11_pkg_build_url'] = pkg.get_pkg_build_url() diff --git a/bauh/gems/arch/pacman.py b/bauh/gems/arch/pacman.py index a08c51b4..b68ff21b 100644 --- a/bauh/gems/arch/pacman.py +++ b/bauh/gems/arch/pacman.py @@ -150,6 +150,20 @@ def list_bin_paths(pkgnames: Set[str]) -> List[str]: return bin_paths +def list_installed_files(pkgname: str) -> List[str]: + installed_files = new_subprocess(['pacman', '-Qlq', pkgname]) + + f_paths = [] + + for out in new_subprocess(['grep', '-E', '/.+\..+[^/]$'], stdin=installed_files.stdout).stdout: + if out: + line = out.decode().strip() + if line: + f_paths.append(line) + + return f_paths + + def verify_pgp_key(key: str) -> bool: list_key = new_subprocess(['pacman-key', '-l']).stdout @@ -168,3 +182,4 @@ def receive_key(key: str, root_password: str) -> SystemProcess: def sign_key(key: str, root_password: str) -> SystemProcess: return SystemProcess(new_root_subprocess(['pacman-key', '--lsign-key', key], root_password=root_password), check_error_output=False) + diff --git a/bauh/gems/arch/resources/locale/en b/bauh/gems/arch/resources/locale/en index c3af4bfa..d6ed0e17 100644 --- a/bauh/gems/arch/resources/locale/en +++ b/bauh/gems/arch/resources/locale/en @@ -22,6 +22,7 @@ arch.clone=Cloning the AUR repository {} arch.downgrade.reading_commits=Reading the repository commits arch.downgrade.version_found=Current package version found arch.downgrade.install_older=Installing older version +aur.info.00_pkg_build=pkgbuild aur.info.01_id=id aur.info.02_name=name aur.info.03_version=version @@ -36,6 +37,7 @@ aur.info.11_pkg_build_url=url pkgbuild aur.info.13_pkg_build=pkgbuild aur.info.11_dependson=dependencies aur.info.12_optdepends=optional dependencies +aur.info.14_installed_files=Installed files arch.install.dep_not_found.title=Dependency not found arch.install.dep_not_found.body=Required dependency {} was not found in AUR nor in default mirrors. Installation cancelled. arch.install.dependency.install=Installing package dependency {} diff --git a/bauh/gems/arch/resources/locale/es b/bauh/gems/arch/resources/locale/es index 5c72e2b2..6bd4da7d 100644 --- a/bauh/gems/arch/resources/locale/es +++ b/bauh/gems/arch/resources/locale/es @@ -54,6 +54,7 @@ arch.clone=Clonando el repositorio {} de AUR arch.downgrade.reading_commits=Leyendo los commits del repositorio arch.downgrade.version_found=Version actual del paquete encontrada arch.downgrade.install_older=Instalando versión anterior +aur.info.00_pkg_build=pkgbuild aur.info.01_id=id aur.info.02_name=nombre aur.info.03_version=versión @@ -68,6 +69,7 @@ aur.info.11_pkg_build_url=url pkgbuild aur.info.13_pkg_build=pkgbuild aur.info.11_dependson=dependencias aur.info.12_optdepends=dependencias opcionales +aur.info.14_installed_files=Archivos instalados arch.install.dep_not_found.title=Dependencia no encontrada arch.install.dep_not_found.body=No se encontró la dependencia requerida {} en AUR ni en los espejos predeterminados. Instalación cancelada. arch.install.dependency.install=Instalando el paquete dependiente {} diff --git a/bauh/gems/arch/resources/locale/pt b/bauh/gems/arch/resources/locale/pt index 03760cc0..d762e500 100644 --- a/bauh/gems/arch/resources/locale/pt +++ b/bauh/gems/arch/resources/locale/pt @@ -54,6 +54,7 @@ arch.clone=Clonando o repositório {} do AUR arch.downgrade.reading_commits=Lendo os commits do repositório arch.downgrade.version_found=Versão atual do pacote encontrada arch.downgrade.install_older=Instalando versão anterior +aur.info.00_pkg_build=pkgbuild aur.info.01_id=id aur.info.02_name=nome aur.info.03_version=versão @@ -68,6 +69,7 @@ aur.info.11_pkg_build_url=url pkgbuild aur.info.13_pkg_build=pkgbuild aur.info.11_dependson=dependências aur.info.12_optdepends=dependências opcionais +aur.info.14_installed_files=Arquivos instalados arch.install.dep_not_found.title=Dependência não encontrada arch.install.dep_not_found.body=A dependência {} não foi encontrado no AUR nem nos espelhos padrões. Instalação cancelada. arch.install.dependency.install=Instalando o pacote dependente {}