Skip to content

Commit

Permalink
0.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
vinifmor authored Apr 24, 2020
2 parents f6a8ea7 + f2d8079 commit a5fd0c5
Show file tree
Hide file tree
Showing 51 changed files with 650 additions and 225 deletions.
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,34 @@ 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.1] 2020-04-24
### Features
- Tray
- displaying a notification when there is a new bauh release
- Arch
- allowing to uninstall no longer needed packages after a package uninstall [#87](https://github.com/vinifmor/bauh/issues/87)

### Improvements
- Internet availability checking code
- Arch
- displaying if an AUR package was successfully upgraded on the details output [#89](https://github.com/vinifmor/bauh/issues/89)
- Settings
- **disk.trim_after_update** has changed to **disk.trim.after_upgrade** and accepts 3 possible values: **false** (No): disabled, **true** (Yes): automatically trims, **null** (Ask): displays a confirmation dialog

### Fixes
- Arch
- not stopping the upgrade process if a transaction error happens
- search not displaying installed packages that are no longer available on the databases ( e.g: indicator-application )
- wrong upgrade substatus in some scenarios
- wrong dialog titles
- AppImage
- not detecting some updates ( e.g: RPCS3 )

### UI
- Changed the main toolbar buttons and custom actions button ('+') styles
- Changed some colors
- Removed the **x** button from some dialogs

## [0.9.0] - 2020-04-15
### Features
- Backup
Expand Down
24 changes: 4 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,6 @@ Before uninstalling bauh via your package manager, consider executing `bauh --re
### Gems ( package technology support )
#### Flatpak ( flatpak )

<p align="center">
<img src="https://raw.githubusercontent.com/vinifmor/bauh/staging/pictures/flatpak/search.gif">
</p>


- Supported actions: search, install, uninstall, downgrade, launch, history
- The configuration file is located at **~/.config/bauh/flatpak.yml** and it allows the following customizations:
```
Expand All @@ -117,23 +112,15 @@ installation_level: null # defines a default installation level: user or system.

#### Snap ( snap )

<p align="center">
<img src="https://raw.githubusercontent.com/vinifmor/bauh/staging/pictures/snap/search.gif">
</p>


- Supported actions: search, install, uninstall, launch, downgrade
- Custom actions: refresh
- Required dependencies:
- Any distro: **snapd** ( it must be enabled after its installation. Details at https://snapcraft.io/docs/installing-snapd )

#### AppImage ( appimage )

<p align="center">
<img src="https://raw.githubusercontent.com/vinifmor/bauh/staging/pictures/appimage/search.gif">
</p>

- Supported actions: search, install, uninstall, downgrade, launch, history
- **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
- **Upgrade file**: allows to upgrade a manually installed AppImage file
Expand All @@ -158,11 +145,6 @@ db_updater:
- P.S: **aria2 will only be used if multi-threaded downloads are enabled**

#### Arch ( Repositories / AUR )

<p align="center">
<img src="https://raw.githubusercontent.com/vinifmor/bauh/staging/pictures/arch/search.gif">
</p>

- Only available for **Arch-based systems**
- Repository packages supported actions: search, install, uninstall, launch
- AUR packages supported actions: search, install, uninstall, downgrade, launch, history
Expand Down Expand Up @@ -296,7 +278,9 @@ ui:
updates:
check_interval: 30 # the updates checking interval in SECONDS
disk:
trim_after_update: false # it trims the hard disk after a successfull packages upgrade ( `fstrim -a -v` )
trim:
after_upgrade: false # it trims the hard disk after a successfull packages upgrade ( `fstrim -a -v` ). 'true' will automatically perform the trim and 'null' will display a confirmation dialog
backup:
enabled: true # generate timeshift snapshots before an action ( if timeshift is installed on the system )
mode: 'incremental' # incremental=generates a new snapshot based on another pre-exising one. 'only_one'=deletes all pre-existing snapshots and generates a fresh one.
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.0'
__version__ = '0.9.1'
__app_name__ = 'bauh'

import os
Expand Down
4 changes: 3 additions & 1 deletion bauh/api/abstract/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ def print(self, msg: str):
"""
pass

def request_confirmation(self, title: str, body: str, components: List[ViewComponent] = None, confirmation_label: str = None, deny_label: str = None, deny_button: bool = True)-> bool:
def request_confirmation(self, title: str, body: str, components: List[ViewComponent] = None, confirmation_label: str = None,
deny_label: str = None, deny_button: bool = True, window_cancel: bool = True) -> bool:
"""
request a user confirmation. In the current GUI implementation, it shows a popup to the user.
:param title: popup title
Expand All @@ -26,6 +27,7 @@ def request_confirmation(self, title: str, body: str, components: List[ViewCompo
:param confirmation_label: optional confirmation button label (default to 'yes')
:param deny_label: optional deny button label (default to 'no')
:param deny_button: if the deny button should be displayed
:param window_cancel: if the window cancel button should be visible
:return: if the request was confirmed by the user
"""
pass
Expand Down
13 changes: 6 additions & 7 deletions bauh/commons/internet.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import subprocess
import traceback
from subprocess import Popen
import http.client as http_client


def is_available() -> bool:
conn = http_client.HTTPConnection("www.google.com", timeout=5)
try:
res = Popen(['ping', '-q', '-w1', '-c1', 'google.com'], stderr=subprocess.DEVNULL, stdout=subprocess.DEVNULL)
res.wait()
return res.returncode == 0
conn.request("HEAD", "/")
conn.close()
return True
except:
traceback.print_exc()
conn.close()
return False
15 changes: 13 additions & 2 deletions bauh/commons/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class SimpleProcess:

def __init__(self, cmd: List[str], cwd: str = '.', expected_code: int = None,
global_interpreter: bool = USE_GLOBAL_INTERPRETER, lang: str = DEFAULT_LANG, root_password: str = None,
extra_paths: Set[str] = None):
extra_paths: Set[str] = None, error_phrases: Set[str] = None):
pwdin, final_cmd = None, []

if root_password is not None:
Expand All @@ -76,6 +76,7 @@ def __init__(self, cmd: List[str], cwd: str = '.', expected_code: int = None,

self.instance = self._new(final_cmd, cwd, global_interpreter, lang, stdin=pwdin, extra_paths=extra_paths)
self.expected_code = expected_code
self.error_phrases = error_phrases

def _new(self, cmd: List[str], cwd: str, global_interpreter: bool, lang: str, stdin = None, extra_paths: Set[str] = None) -> subprocess.Popen:

Expand Down Expand Up @@ -175,8 +176,18 @@ def handle_simple(self, proc: SimpleProcess, output_handler=None) -> Tuple[bool,

self._notify_watcher(line)

proc.instance.wait()
output.seek(0)
return proc.instance.returncode == proc.expected_code, output.read()

success = proc.instance.returncode == proc.expected_code,
string_output = output.read()

if proc.error_phrases:
for phrase in proc.error_phrases:
if phrase in string_output:
success = False
break
return success, string_output


def run_cmd(cmd: str, expected_code: int = 0, ignore_return_code: bool = False, print_error: bool = True,
Expand Down
3 changes: 2 additions & 1 deletion bauh/gems/appimage/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import subprocess
import traceback
from datetime import datetime
from distutils.version import LooseVersion
from math import floor
from pathlib import Path
from threading import Lock
Expand Down Expand Up @@ -216,7 +217,7 @@ def read_installed(self, disk_loader: DiskCacheLoader, limit: int = -1, only_app
for tup in cursor.fetchall():
for app in res.installed:
if app.name.lower() == tup[0].lower() and (not app.github or app.github.lower() == tup[1].lower()):
app.update = tup[2] > app.version
app.update = LooseVersion(tup[2]) > LooseVersion(app.version) if tup[2] else False

if app.update:
app.latest_version = tup[2]
Expand Down
Loading

0 comments on commit a5fd0c5

Please sign in to comment.