Skip to content

Commit

Permalink
0.9.4
Browse files Browse the repository at this point in the history
  • Loading branch information
vinifmor authored May 29, 2020
2 parents 01b1a52 + 48791b0 commit 895443a
Show file tree
Hide file tree
Showing 64 changed files with 1,554 additions and 177 deletions.
58 changes: 58 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,64 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [0.9.4] 2020-05-29
### Features
- Ignore updates: now it is possible to ignore updates from software packages through their actions button (**+**). Supported types: Arch packages, Flatpaks and AppImages

<p align="center">
<img src="https://raw.githubusercontent.com/vinifmor/bauh/staging/pictures/releases/0.9.4/ignore_updates.png">
</p>
<p align="center">
<img src="https://raw.githubusercontent.com/vinifmor/bauh/staging/pictures/releases/0.9.4/revert_ignored_updates.png">
</p>
- Packages with ignored updates have their versions displayed with a brown shade
<p align="center">
<img src="https://raw.githubusercontent.com/vinifmor/bauh/staging/pictures/releases/0.9.4/version_ignored_updates.png">
</p>
- It is possible to filter all you packages with updates ignored through the new category **Updates ignored**
<p align="center">
<img src="https://raw.githubusercontent.com/vinifmor/bauh/staging/pictures/releases/0.9.4/updates_ignored_category.png">
</p>

- Arch
- supporting multi-threaded download for repository packages (enabled by default)
<p align="center">
<img src="https://raw.githubusercontent.com/vinifmor/bauh/staging/pictures/releases/0.9.4/arch_repo_mthread.png">
</p>

- Settings
- [axel](https://github.com/axel-download-accelerator/axel) added as an alternative multi-threaded download tool. The download tool can be defined through the new field **Multi-threaded download tool** on the settings window **Advanced** tab (check **Default** for bauh to decide which one to use)
<p align="center">
<img src="https://raw.githubusercontent.com/vinifmor/bauh/staging/pictures/releases/0.9.4/mthread_tool.png">
</p>



### Improvements
- Arch
- faster caching data process during initialization
- i18n
- AppImage
- Categories are now translated on the Info window

- UI
- only centralizing the apps table after the initialization process
- defining a minimum width and height based on the screen size
- info window now has a height limit, a lower bar with Back and Close buttons, and is scrollable
- minor changes
- Downloads
- retrieving the downloading file sizes asynchronously

### Fixes
- Flatpak
- not displaying application updates on the search results
- Arch
- crashing while reading the installed packages when the internet is unstable

- initialization dialog hangs when there is no task to wait for [#112](https://github.com/vinifmor/bauh/issues/112)
- not caching data of installed packages with no signatures and unknown repositories


## [0.9.3] 2020-05-12
### Features
- new **restore** action to restore all bauh settings and cache through the 'custom actions' button (**+**). It is equivalent to the command `bauh --reset`.
Expand Down
21 changes: 13 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
</p>


**bauh** ( ba-oo ), formerly known as **fpakman**, is a graphical interface for managing your Linux applications / packages. It currently supports
the following types: AppImage, Arch ( repositories / AUR ), Flatpak, Snap and native Web applications.
**bauh** ( ba-oo ), formerly known as **fpakman**, is a graphical interface for managing your Linux applications/packages. It currently supports
the following formats: AppImage, Arch ( repositories / AUR ), Flatpak, Snap and native Web applications.

Key features:
- A management panel where you can: search, install, uninstall, launch, downgrade and retrieve the release history from software packages.
- A management panel where you can: search, install, uninstall, upgrade, downgrade, launch, ignore updates and retrieve releases history from software packages./
- Tray mode: launches attached to the system tray and publishes notifications when there are software updates available
- System backup: it integrates with **Timeshift** to provide a simple and safe backup process before applying any change to your system.

Expand Down Expand Up @@ -101,7 +101,8 @@ Before uninstalling bauh via your package manager, consider executing `bauh --re
### Gems ( package technology support )
#### Flatpak ( flatpak )

- Supported actions: search, install, uninstall, downgrade, launch, history
- Supported actions: search, install, uninstall, downgrade, launch, history and ignore updates
- Applications with ignored updates are defined at **~/.config/bauh/flatpak/updates_ignored.txt**
- The configuration file is located at **~/.config/bauh/flatpak.yml** and it allows the following customizations:
```
installation_level: null # defines a default installation level: user or system. ( the popup will not be displayed if a value is defined )
Expand All @@ -119,7 +120,7 @@ installation_level: null # defines a default installation level: user or system.

#### AppImage ( appimage )

- Supported actions: search, install, uninstall, downgrade, launch, history
- Supported actions: search, install, uninstall, downgrade, launch, history and ignore updates
- **Only x86_64 AppImage files are available through the search mechanism at the moment**
- Custom actions
- **Install AppImage file**: allows to install a external AppImage file
Expand All @@ -132,6 +133,7 @@ installation_level: null # defines a default installation level: user or system.
- Databases updater daemon running every 20 minutes ( it can be customized via the configuration file described below )
- Crashes may happen during an AppImage installation if **AppImageLauncher** is installed. It is advisable to uninstall it and reboot the system before trying to install an application.
- All supported application names can be found at [apps.txt](https://github.com/vinifmor/bauh-files/blob/master/appimage/apps.txt)
- Applications with ignored updates are defined at **~/.config/bauh/appimage/updates_ignored.txt**
- The configuration file is located at **~/.config/bauh/appimage.yml** and it allows the following customizations:
```
db_updater:
Expand All @@ -146,8 +148,8 @@ db_updater:

#### Arch ( Repositories / AUR )
- Only available for **Arch-based systems**
- Repository packages supported actions: search, install, uninstall, launch
- AUR packages supported actions: search, install, uninstall, downgrade, launch, history
- Repository packages supported actions: search, install, uninstall, launch and ignore updates
- AUR packages supported actions: search, install, uninstall, downgrade, launch, history and ignore updates
- It handles conflicts, missing / optional packages installations, and several providers scenarios
- Automatically makes simple package compilation improvements:

Expand All @@ -169,6 +171,7 @@ db_updater:
- **refresh mirrors**: allows the user to define multiple mirrors locations and sort by the fastest ( `sudo pacman-mirrors -c country1,country2 && sudo pacman-mirrors --fasttrack 5 && sudo pacman -Syy` )
- **quick system upgrade**: it executes a default pacman upgrade ( `pacman -Syyu --noconfirm` )
- **clean cache**: it cleans the pacman cache diretory ( default: `/var/cache/pacman/pkg` )
- Packages with ignored updates are defined at **~/.config/bauh/arch/updates_ignored.txt**
- The configuration file is located at **~/.config/bauh/arch.yml** and it allows the following customizations:
```
optimize: true # if 'false': disables the auto-compilation improvements
Expand All @@ -179,6 +182,7 @@ refresh_mirrors_startup: false # if the package mirrors should be refreshed duri
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
repositories: true # allows to manage packages from the configured repositories
repositories_mthread_download: true # enable multi-threaded download for repository packages if aria2 is installed
```
- Required dependencies:
- **pacman**
Expand Down Expand Up @@ -253,7 +257,8 @@ You can change some application settings via environment variables or arguments
```
download:
icons: true # allows bauh to download the applications icons when they are not saved on the disk
multithreaded: true # allows bauh to use a multithreaded download client installed on the system to download applications source files faster ( current only **aria2** is supported )
multithreaded: true # allows bauh to use a multithreaded download client installed on the system to download applications source files faster
multithreaded_client: null # defines the multi-threaded download tool to be used. If null, the default installed tool will be used (priority: aria2 > axel). Possible tools/values: aria2, axel
gems: null # defines the enabled applications types managed by bauh ( a null value means all available )
locale: null # defines a different translation for bauh ( a null value will retrieve the system's default locale )
store_root_password: true # if the root password should be asked only once
Expand Down
2 changes: 1 addition & 1 deletion bauh/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '0.9.3'
__version__ = '0.9.4'
__app_name__ = 'bauh'

import os
Expand Down
6 changes: 6 additions & 0 deletions bauh/api/abstract/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,3 +340,9 @@ def get_custom_actions(self) -> List[CustomSoftwareAction]:

def fill_sizes(self, pkgs: List[SoftwarePackage]):
pass

def ignore_update(self, pkg: SoftwarePackage):
pass

def revert_ignored_update(self, pkg: SoftwarePackage):
pass
25 changes: 20 additions & 5 deletions bauh/api/abstract/download.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
from abc import ABC, abstractmethod
from typing import Iterable, List

from bauh.api.abstract.handler import ProcessWatcher


class FileDownloader(ABC):

@abstractmethod
def download(self, file_url: str, watcher: ProcessWatcher, output_path: str, cwd: str) -> bool:
def download(self, file_url: str, watcher: ProcessWatcher, output_path: str, cwd: str, root_password: str = None, substatus_prefix: str = None, display_file_size: bool = True, max_threads: int = None, known_size: int = None) -> bool:
"""
:param file_url:
:param watcher:
:param output_path: the downloaded file output path. Leave None for the current directory and the same file name
:param cwd: current working directory. Leave None if does not matter.
:param root_password: (if the output directory is protected)
:param substatus_prefix: custom substatus prefix ('prefix downloading xpto')
:param display_file_size: if the file size should be displayed on the substatus
:param max_threads: maximum number of threads (only available for multi-threaded download)
:param known_size: known file size
:return: success / failure
"""
pass
Expand All @@ -21,8 +27,17 @@ def is_multithreaded(self) -> bool:
pass

@abstractmethod
def get_default_client_name(self) -> str:
"""
:return: retrieve current downloader client name
"""
def can_work(self) -> bool:
pass

@abstractmethod
def get_supported_multithreaded_clients(self) -> Iterable[str]:
pass

@abstractmethod
def is_multithreaded_client_available(self, name: str) -> bool:
pass

@abstractmethod
def list_available_multithreaded_clients(self) -> List[str]:
pass
6 changes: 6 additions & 0 deletions bauh/api/abstract/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ def can_be_uninstalled(self):
def can_be_installed(self):
return not self.installed

def is_update_ignored(self) -> bool:
return False

def supports_ignored_updates(self) -> bool:
return False

@abstractmethod
def get_type(self):
"""
Expand Down
5 changes: 3 additions & 2 deletions bauh/api/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,12 @@ def get_content_length(self, url: str, session: bool = True) -> str:
if size:
return system.get_human_size_str(size)

def exists(self, url: str, session: bool = True) -> bool:
params = {'url': url, 'allow_redirects': True, 'verify': False, 'timeout': 5}
def exists(self, url: str, session: bool = True, timeout: int = 5) -> bool:
params = {'url': url, 'allow_redirects': True, 'verify': False, 'timeout': timeout}
if session:
res = self.session.head(**params)
else:
res = self.session.get(**params)

return res.status_code in (200, 403)
return False
5 changes: 5 additions & 0 deletions bauh/commons/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,3 +272,8 @@ def get_human_size_str(size) -> str:
if len(size_str.split('.')[0]) < 4:
return '{0:.2f}'.format(float(size_str)) + ' ' + m[1]
return str(int_size)


def run(cmd: List[str], success_code: int = 0) -> Tuple[bool, str]:
p = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
return p.returncode == success_code, p.stdout.decode()
2 changes: 2 additions & 0 deletions bauh/gems/appimage/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
INSTALLATION_PATH = LOCAL_PATH + '/installed/'
SUGGESTIONS_FILE = 'https://raw.githubusercontent.com/vinifmor/bauh-files/master/appimage/suggestions.txt'
CONFIG_FILE = '{}/appimage.yml'.format(CONFIG_PATH)
CONFIG_DIR = '{}/appimage'.format(CONFIG_PATH)
UPDATES_IGNORED_FILE = '{}/updates_ignored.txt'.format(CONFIG_DIR)


def get_icon_path() -> str:
Expand Down
75 changes: 64 additions & 11 deletions bauh/gems/appimage/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
from bauh.commons.config import save_config
from bauh.commons.html import bold
from bauh.commons.system import SystemProcess, new_subprocess, ProcessHandler, run_cmd, SimpleProcess
from bauh.gems.appimage import query, INSTALLATION_PATH, LOCAL_PATH, SUGGESTIONS_FILE, CONFIG_FILE, ROOT_DIR
from bauh.gems.appimage import query, INSTALLATION_PATH, LOCAL_PATH, SUGGESTIONS_FILE, CONFIG_FILE, ROOT_DIR, \
CONFIG_DIR, UPDATES_IGNORED_FILE
from bauh.gems.appimage.config import read_config
from bauh.gems.appimage.model import AppImage
from bauh.gems.appimage.worker import DatabaseUpdater
Expand Down Expand Up @@ -235,6 +236,13 @@ def read_installed(self, disk_loader: DiskCacheLoader, limit: int = -1, only_app
if not connection:
self._close_connection(DB_APPS_PATH, con)

ignored_updates = self._read_ignored_updates()

if ignored_updates:
for app in res.installed:
if app.supports_ignored_updates() and app.name in ignored_updates:
app.updates_ignored = True

res.total = len(res.installed)
return res

Expand Down Expand Up @@ -308,6 +316,8 @@ def uninstall(self, pkg: AppImage, root_password: str, watcher: ProcessWatcher)
if os.path.exists(de_path):
os.remove(de_path)

self.revert_ignored_update(pkg)

return True

def get_managed_types(self) -> Set[Type[SoftwarePackage]]:
Expand All @@ -324,6 +334,11 @@ def get_info(self, pkg: AppImage) -> dict:
if size:
data['size'] = size

categories = data.get('categories')

if categories:
data['categories'] = [self.i18n.get('category.{}'.format(c.lower()), self.i18n.get(c, c)).capitalize() for c in data['categories']]

return data

def get_history(self, pkg: AppImage) -> PackageHistory:
Expand Down Expand Up @@ -502,16 +517,8 @@ def _is_sqlite3_available(self):
res = run_cmd('which sqlite3')
return res and not res.strip().startswith('which ')

def _is_wget_available(self):
res = run_cmd('which wget')
return res and not res.strip().startswith('which ')

def _is_aria2_available(self):
res = run_cmd('which aria2c')
return res and not res.strip().startswith('which ')

def can_work(self) -> bool:
return self._is_sqlite3_available() and (self._is_wget_available() or self._is_aria2_available())
return self._is_sqlite3_available() and self.file_downloader.can_work()

def requires_root(self, action: str, pkg: AppImage):
return False
Expand All @@ -535,7 +542,7 @@ def list_updates(self, internet_available: bool) -> List[PackageUpdate]:
updates = []
if res.installed:
for app in res.installed:
if app.update:
if app.update and not app.is_update_ignored():
updates.append(PackageUpdate(pkg_id=app.name, pkg_type='AppImage', version=app.latest_version, name=app.name))

return updates
Expand Down Expand Up @@ -684,3 +691,49 @@ def get_upgrade_requirements(self, pkgs: List[AppImage], root_password: str, wat
to_update.append(requirement)

return UpgradeRequirements([], [], to_update, [])

def _read_ignored_updates(self) -> Set[str]:
ignored = set()
if os.path.exists(UPDATES_IGNORED_FILE):
with open(UPDATES_IGNORED_FILE) as f:
ignored_txt = f.read()

for l in ignored_txt.split('\n'):
if l:
line_clean = l.strip()

if line_clean:
ignored.add(line_clean)

return ignored

def ignore_update(self, pkg: AppImage):
current_ignored = self._read_ignored_updates()

if pkg.name not in current_ignored:
current_ignored.add(pkg.name)
self._write_ignored_updates(current_ignored)

pkg.updates_ignored = True

def _write_ignored_updates(self, names: Set[str]):
Path(CONFIG_DIR).mkdir(parents=True, exist_ok=True)
ignored_list = [*names]
ignored_list.sort()

with open(UPDATES_IGNORED_FILE, 'w+') as f:
if ignored_list:
for ignored in ignored_list:
f.write('{}\n'.format(ignored))
else:
f.write('')

def revert_ignored_update(self, pkg: AppImage):
current_ignored = self._read_ignored_updates()

if current_ignored and pkg.name in current_ignored:
current_ignored.remove(pkg.name)

self._write_ignored_updates(current_ignored)

pkg.updates_ignored = False
Loading

0 comments on commit 895443a

Please sign in to comment.