Skip to content

Commit

Permalink
0.9.12
Browse files Browse the repository at this point in the history
  • Loading branch information
vinifmor authored Jan 19, 2021
2 parents 0776511 + f7b4857 commit 4568aef
Show file tree
Hide file tree
Showing 51 changed files with 1,240 additions and 344 deletions.
64 changes: 64 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,70 @@ 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.12] 2021-01-19
### Features
- Arch
- AUR
- [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' (on the table), a tip will be displayed with the message "It needs to be reinstalled".
- this integration can be controlled though the new settings property **aur_rebuild_detector** (default: true).
<p align="center">
<img src="https://raw.githubusercontent.com/vinifmor/bauh-files/master/pictures/releases/0.9.12/rebuild_detector.png">
</p>

- new package actions to Allow/Ignore rebuild check for a specific package
<p align="center">
<img src="https://raw.githubusercontent.com/vinifmor/bauh-files/master/pictures/releases/0.9.12/allow_rebuild_check.png">
</p>

<p align="center">
<img src="https://raw.githubusercontent.com/vinifmor/bauh-files/master/pictures/releases/0.9.12/ignore_rebuild_check.png">
</p>

- new settings property **aur_rebuild_detector_no_bin** to ignore binary packages when checking with rebuild-detector (e.g: package-bin ). Default: true
<p align="center">
<img src="https://raw.githubusercontent.com/vinifmor/bauh-files/master/pictures/releases/0.9.12/ignore_bin.png">
</p>

- new custom action to quickly reinstall a package
<p align="center">
<img src="https://raw.githubusercontent.com/vinifmor/bauh-files/master/pictures/releases/0.9.12/aur_reinstall.png">
</p>

### Improvements
- Arch
- repositories/AUR search time (=~ -70%)
- new category to filter packages removed from AUR (only available for packages installed from AUR through bauh)
<p align="center">
<img src="https://raw.githubusercontent.com/vinifmor/bauh-files/master/pictures/releases/0.9.12/aur_removed.png">
</p>

- Core
- saving settings time (=~ -11%)
- internet checking time (=~ -58%)
- UI
- not displaying the number of packages when none is displayed / available
- minor improvements

### Fixes
- Arch
- crashing when information of a given package is not available
- displaying "provided" repository packages on the search results (e.g: **nvidia** would appear as a package)
- calling pacman to read installed packages when "Repositories" and "AUR" properties are set to "false" (it would not display the packages, but the call was unnecessary being done)
- not displaying installed AUR packages when AUR support is disabled
- displaying packages removed from AUR as AUR packages
- downloading AUR index during the initialization process when AUR support is disabled
- Flatpak
- crashing for version 1.10 [#167](https://github.com/vinifmor/bauh/issues/167)
- crashing when trying to retrieve size of runtimes subcomponents [#164](https://github.com/vinifmor/bauh/issues/164)
- UI
- initialization dialog hanging sometimes (due to thread locking)
- settings dialog hangs sometimes when the button "Change" is clicked
- displaying a popup when information of a given package is not available
- wrong package type icon size depending on resolution


## [0.9.11] 2020-12-30
### New system requirements
- **python-dateutil**: better Python library for date handling (install the equivalent package for your Linux distribution before upgrading bauh)
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ database:
- 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
- [rebuild-detector](https://github.com/maximbaz/rebuild-detector) integration (AUR only)
- Automatically makes simple package compilation improvements:

a) if **MAKEFLAGS** is not set in **/etc/makepkg.conf**,
Expand All @@ -187,6 +188,8 @@ database:
- **clean cache**: it cleans the pacman cache directory (default: `/var/cache/pacman/pkg`)
- **mark PKGBUILD as editable**: it marks a given PKGBUILD of a package as editable (a popup with the PKGBUILD will be displayed before upgrading/downgrading this package). Action only available when the configuration property **edit_aur_pkgbuild** is not **false**.
- **unmark PKGBUILD as editable**: reverts the action described above. Action only available when the configuration property **edit_aur_pkgbuild** is not **false**.
- **allow reinstallation check**: it allows to check if a given AUR packages requires to be rebuilt
- **ignore reinstallation check**: it does not to check if a given AUR packages requires to be rebuilt
- **check Snaps support**: checks if the Snapd services are properly enabled.
- Installed AUR packages have their **PKGBUILD** files cached at **~/.cache/bauh/arch/installed/$pkgname**
- Packages with ignored updates are defined at **~/.config/bauh/arch/updates_ignored.txt**
Expand All @@ -211,6 +214,7 @@ check_dependency_breakage: true # if, during the verification of the update requ
suggest_unneeded_uninstall: false # if the dependencies apparently no longer necessary associated with the uninstalled packages should be suggested for uninstallation. When this property is enabled it automatically disables the property 'suggest_optdep_uninstall'. Default: false (to prevent new users from making mistakes)
suggest_optdep_uninstall: false # if the optional dependencies associated with uninstalled packages should be suggested for uninstallation. Only the optional dependencies that are not dependencies of other packages will be suggested. Default: false (to prevent new users from making mistakes)
categories_exp: 24 # It defines the expiration time (in HOURS) of the packages categories mapping file stored in disc. Use 0 so that it is always updated during initialization.
aur_rebuild_detector: true # 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 ('rebuild-detector' must be installed). Default: true.
```
- Required dependencies:
- **pacman**
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.11'
__version__ = '0.9.12'
__app_name__ = 'bauh'

import os
Expand Down
11 changes: 11 additions & 0 deletions bauh/api/abstract/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@ def __init__(self, installed: Optional[List[SoftwarePackage]], new: Optional[Lis
self.new = new
self.total = total

def update_total(self):
total = 0

if self.installed:
total += len(self.installed)

if self.new:
total += len(self.new)

self.total = total

@classmethod
def empty(cls):
return cls(installed=[], new=[], total=0)
Expand Down
4 changes: 4 additions & 0 deletions bauh/api/abstract/disk.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,7 @@ def map(self, pkg_type: Type[SoftwarePackage], cache: MemoryCache):
:return:
"""
pass

@abstractmethod
def new(self) -> DiskCacheLoader:
pass
8 changes: 7 additions & 1 deletion bauh/api/abstract/model.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from abc import ABC, abstractmethod
from enum import Enum
from typing import List
from typing import List, Optional

from bauh.api.constants import CACHE_PATH

Expand Down Expand Up @@ -223,6 +223,12 @@ def get_display_name(self) -> str:
"""
return self.name

def get_update_tip(self) -> Optional[str]:
"""
custom 'version' update tooltip
"""
return

@abstractmethod
def supports_backup(self) -> bool:
pass
Expand Down
54 changes: 41 additions & 13 deletions bauh/api/abstract/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,6 @@ def __init__(self):
super(SpacerComponent, self).__init__(id_=None)


class PanelComponent(ViewComponent):

def __init__(self, components: List[ViewComponent], id_: str = None):
super(PanelComponent, self).__init__(id_=id_)
self.components = components
self.component_map = {c.id: c for c in components if c.id is not None} if components else None

def get_component(self, id_: str) -> ViewComponent:
if self.component_map:
return self.component_map.get(id_)


class InputViewComponent(ViewComponent):
"""
Represents an component which needs a user interaction to provide its value
Expand Down Expand Up @@ -96,6 +84,7 @@ def __init__(self, type_: SelectViewType, label: str, options: List[InputOption]
self.label = label
self.options = options
self.value = default_option
self.init_value = default_option
self.max_per_line = max_per_line
self.tooltip = tooltip
self.max_width = max_width
Expand All @@ -105,6 +94,9 @@ def get_selected(self):
if self.value:
return self.value.value

def changed(self) -> bool:
return self.init_value != self.value


class MultipleSelectComponent(InputViewComponent):

Expand Down Expand Up @@ -214,10 +206,26 @@ def __init__(self, components: List[ViewComponent], label: str = None, spaces: b
self.components = components
self.component_map = {c.id: c for c in components if c.id} if components else None

def get_component(self, id_: str) -> ViewComponent:
def get_component(self, id_: str) -> Optional[ViewComponent]:
if self.component_map:
return self.component_map.get(id_)

def get_single_select_component(self, id_: str) -> Optional[SingleSelectComponent]:
comp = self.get_component(id_)

if comp:
if not isinstance(comp, SingleSelectComponent):
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):

Expand Down Expand Up @@ -281,3 +289,23 @@ def __init__(self, id_: str, label: str, tooltip: str, min_value: float, max_val
self.step = step_value
self.value = value
self.max_width = max_width


class PanelComponent(ViewComponent):

def __init__(self, components: List[ViewComponent], id_: str = None):
super(PanelComponent, self).__init__(id_=id_)
self.components = components
self.component_map = {c.id: c for c in components if c.id is not None} if components else None

def get_component(self, id_: str) -> Optional[ViewComponent]:
if self.component_map:
return self.component_map.get(id_)

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
8 changes: 3 additions & 5 deletions bauh/commons/internet.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import http.client as http_client
import socket


class InternetChecker:
Expand All @@ -10,11 +10,9 @@ def is_available(self) -> bool:
if self.offline:
return False

conn = http_client.HTTPConnection("www.google.com", timeout=5)
try:
conn.request("HEAD", "/")
conn.close()
socket.gethostbyname('google.com')
return True
except:
conn.close()
return False

26 changes: 19 additions & 7 deletions bauh/commons/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@
SIZE_MULTIPLIERS = ((0.001, 'Kb'), (0.000001, 'Mb'), (0.000000001, 'Gb'), (0.000000000001, 'Tb'))


def gen_env(global_interpreter: bool, lang: str = DEFAULT_LANG, extra_paths: Set[str] = None) -> dict:
def gen_env(global_interpreter: bool, lang: str = DEFAULT_LANG, extra_paths: Optional[Set[str]] = None) -> dict:
custom_env = dict(os.environ)

if lang:
custom_env['LANG'] = lang

if global_interpreter: # to avoid subprocess calls to the virtualenv python interpreter instead of the global one.
custom_env['PATH'] = GLOBAL_INTERPRETER_PATH

else:
custom_env['PATH'] = PATH

Expand Down Expand Up @@ -322,11 +323,22 @@ def check_enabled_services(*names: str) -> Dict[str, bool]:
return {s: status[i].strip().lower() == 'enabled' for i, s in enumerate(names) if s}


def execute(cmd: str, shell: bool = False, cwd: Optional[str] = None, output: bool = True) -> Tuple[int, Optional[str]]:
p = subprocess.run(args=cmd.split(' ') if not shell else [cmd],
stdout=subprocess.PIPE if output else subprocess.DEVNULL,
stderr=subprocess.STDOUT if output else subprocess.DEVNULL,
shell=shell,
cwd=cwd)
def execute(cmd: str, shell: bool = False, cwd: Optional[str] = None, output: bool = True, custom_env: Optional[dict] = None, stdin: bool = True) -> Tuple[int, Optional[str]]:
params = {
'args': cmd.split(' ') if not shell else [cmd],
'stdout': subprocess.PIPE if output else subprocess.DEVNULL,
'stderr': subprocess.STDOUT if output else subprocess.DEVNULL,
'shell': shell
}

if not stdin:
params['stdin'] = subprocess.DEVNULL

if cwd is not None:
params['cwd'] = cwd

if custom_env is not None:
params['env'] = custom_env

p = subprocess.run(**params)
return p.returncode, p.stdout.decode() if p.stdout else None
1 change: 1 addition & 0 deletions bauh/gems/arch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
SUGGESTIONS_FILE = 'https://raw.githubusercontent.com/vinifmor/bauh-files/master/arch/aur_suggestions.txt'
UPDATES_IGNORED_FILE = '{}/updates_ignored.txt'.format(CONFIG_DIR)
EDITABLE_PKGBUILDS_FILE = '{}/aur/editable_pkgbuilds.txt'.format(CONFIG_DIR)
IGNORED_REBUILD_CHECK_FILE = '{}/aur/ignored_rebuild_check.txt'.format(CONFIG_DIR)


def get_icon_path() -> str:
Expand Down
4 changes: 3 additions & 1 deletion bauh/gems/arch/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,6 @@ def get_default_config(self) -> dict:
'suggest_unneeded_uninstall': False,
'suggest_optdep_uninstall': False,
'aur_idx_exp': 1,
'categories_exp': 24}
'categories_exp': 24,
'aur_rebuild_detector': True,
"aur_rebuild_detector_no_bin": True}
Loading

0 comments on commit 4568aef

Please sign in to comment.