Skip to content

Commit

Permalink
0.7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
vinifmor authored Dec 9, 2019
2 parents 1d6107b + 5914511 commit 6bd27b5
Show file tree
Hide file tree
Showing 33 changed files with 544 additions and 106 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@ 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.7.4] 2019-12-09
### Improvements
- AUR
- retrieving and displaying all transitive required dependencies ( it can be disabled via the new environment variable **BAUH_ARCH_CHECK_SUBDEPS=0** )
- displaying **makedepends** and **checkdepends** in the info window
- Some AUR labels have been changed to not confuse the user
- **--clean** param renamed to **--reset**
- Minor UI improvements

### Fixes
- AUR
- not finding some dependencies declared as files instead of the package names (e.g: dolphin-emu-git )
- replaces the term **mirror** by **repository**


## [0.7.3] 2019-11-29
### Improvements
- Not breaking the application when a i18n (translation) key was not found
Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ Icon=/home/$USER/bauh_env/lib/python3.7/site-packages/bauh/view/resources/img/lo
In order to autostart the application, use your Desktop Environment settings to register it as a startup application / script (**bauh --tray=1**).

### Uninstallation
Before uninstalling bauh via your package manager, consider executing `bauh --clean` to remove configuration and cache files stored in your **HOME** folder.
Before uninstalling bauh via your package manager, consider executing `bauh --reset` to remove configuration and cache files stored in your **HOME** folder.

### Theme issues
If bauh is not starting properly after changing its style, execute `bauh --reset` to reset its configuration or just delete the **style** key from the file **~/.config/bauh/config.json**.

### Gems ( package technology support )
#### Flatpak ( flatpak )
Expand Down Expand Up @@ -123,10 +126,10 @@ will be pre-downloaded faster ( it does **NOT** modify your **pacman** settings
b) same as previous, but related to **COMPRESSXZ** definition ( if '--threads=0' is not defined )

Obs: this feature can be disabled through the environment variable **BAUH_ARCH_OPTIMIZE=0**
( For more information about these optimizations, have a look at [Makepkg](https://wiki.archlinux.org/index.php/Makepkg)
( For more information about these optimizations, have a look at [Makepkg](https://wiki.archlinux.org/index.php/Makepkg) )
- Arch package memory-indexer running every 20 minutes. This memory index is used when AUR Api cannot handle the amount of results found for a given search. It can be disabled via the environment variable **BAUH_ARCH_AUR_INDEX_UPDATER=0**.
- If some of your installed packages are not categorized, send an e-mail to **[email protected]** informing their names and categories in the following format: ```name=category1[,category2,category3,...]```

- Transitive dependencies checking can be disabled through the environment variable **BAUH_ARCH_CHECK_SUBDEPS=0**. The dependency checking process will be faster, but the application will ask for a confirmation every time a not installed dependency is detected.

### General settings
You can change some application settings via environment variables or arguments (type ```bauh --help``` to get more information).
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.7.3'
__version__ = '0.7.4'
__app_name__ = 'bauh'

import os
Expand Down
2 changes: 1 addition & 1 deletion bauh/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def main():
logger = logs.new_logger(__app_name__, bool(args.logs))
app_args.validate(args, logger)

if args.clean:
if args.reset:
util.clean_app_files()
exit(0)

Expand Down
2 changes: 1 addition & 1 deletion bauh/app_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def read() -> Namespace:
parser.add_argument('--logs', action="store", default=int(os.getenv('BAUH_LOGS', 0)), choices=[0, 1], type=int, help='If the application logs should be displayed. Default: %(default)s')
parser.add_argument('--show-panel', action="store_true", help='Shows the management panel after the app icon is attached to the tray.')
parser.add_argument('-dmt', '--download-mthread', action="store", default=os.getenv('BAUH_DOWNLOAD_MULTITHREAD', 1), choices=[0, 1], type=int, help='If installation files should be downloaded using multi-threads (only possible if aria2c is installed). Not all gems support this feature. Check README.md. Default: %(default)s')
parser.add_argument('--clean', action="store_true", help='Removes all configuration and cache files')
parser.add_argument('--reset', action="store_true", help='Removes all configuration and cache files')
return parser.parse_args()


Expand Down
16 changes: 16 additions & 0 deletions bauh/gems/arch/aur.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
from bauh.api.http import HttpClient
import urllib.parse

from bauh.gems.arch import pacman
from bauh.gems.arch.exceptions import PackageNotFoundException

URL_INFO = 'https://aur.archlinux.org/rpc/?v=5&type=info&'
URL_SRC_INFO = 'https://aur.archlinux.org/cgit/aur.git/plain/.SRCINFO?h='
URL_SEARCH = 'https://aur.archlinux.org/rpc/?v=5&type=search&arg='
Expand Down Expand Up @@ -46,5 +49,18 @@ def get_src_info(self, name: str) -> dict:

return info

def get_all_dependencies(self, name: str) -> Set[str]:
deps = set()
info = self.get_src_info(name)

if not info:
raise PackageNotFoundException(name)

for attr in ('makedepends', 'depends', 'checkdepends'):
if info.get(attr):
deps.update([pacman.RE_DEP_OPERATORS.split(dep)[0] for dep in info[attr]])

return deps

def _map_names_as_queries(self, names) -> str:
return '&'.join(['arg[{}]={}'.format(i, urllib.parse.quote(n)) for i, n in enumerate(names)])
26 changes: 15 additions & 11 deletions bauh/gems/arch/confirmation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Set
from typing import Set, List, Tuple

from bauh.api.abstract.handler import ProcessWatcher
from bauh.api.abstract.view import MultipleSelectComponent, InputOption
Expand All @@ -16,7 +16,7 @@ def request_optional_deps(pkgname: str, pkg_mirrors: dict, watcher: ProcessWatch
opts = []

for p, d in pkg_mirrors.items():
op = InputOption('{}{} ( {}: {} )'.format(p, ': ' + d['desc'] if d['desc'] else '', i18n['mirror'], d['mirror'].upper()), p)
op = InputOption('{}{} ( {}: {} )'.format(p, ': ' + d['desc'] if d['desc'] else '', i18n['repository'], d['mirror'].upper()), p)
op.icon_path = _get_mirror_icon(d['mirror'])
opts.append(op)

Expand All @@ -25,25 +25,29 @@ def request_optional_deps(pkgname: str, pkg_mirrors: dict, watcher: ProcessWatch
default_options=None)

install = watcher.request_confirmation(title=i18n['arch.install.optdeps.request.title'],
body='<p>{}</p>'.format(i18n['arch.install.optdeps.request.body'].format(bold(pkgname)) + ':'),
body='<p>{}.</p><p>{}:</p>'.format(i18n['arch.install.optdeps.request.body'].format(bold(pkgname)), i18n['arch.install.optdeps.request.help']),
components=[view_opts],
confirmation_label=i18n['install'],
deny_label=i18n['cancel'])
confirmation_label=i18n['install'].capitalize(),
deny_label=i18n['do_not.install'].capitalize())

if install:
return {o.value for o in view_opts.values}


def request_install_missing_deps(pkgname: str, pkg_mirrors: dict, watcher: ProcessWatcher, i18n: I18n) -> bool:
msg = '<p>{}</p>'.format(i18n['arch.missing_deps.body'].format(bold(pkgname)) + ':')
def request_install_missing_deps(pkgname: str, deps: List[Tuple[str, str]], watcher: ProcessWatcher, i18n: I18n) -> bool:
msg = '<p>{}</p>'.format(i18n['arch.missing_deps.body'].format(name=bold(pkgname) if pkgname else '', deps=bold(str(len(deps)))))

opts = []
for p, m in pkg_mirrors.items():
op = InputOption('{} ( {}: {} )'.format(p, i18n['mirror'], m.upper()), p)

sorted_deps = [*deps]
sorted_deps.sort(key=lambda e: e[0])

for dep in sorted_deps:
op = InputOption('{} ( {}: {} )'.format(dep[0], i18n['repository'], dep[1].upper()), dep[0])
op.read_only = True
op.icon_path = _get_mirror_icon(m)
op.icon_path = _get_mirror_icon(dep[1])
opts.append(op)

comp = MultipleSelectComponent(label='', options=opts, default_options=set(opts))

return watcher.request_confirmation(i18n['arch.missing_deps.title'], msg, [comp], confirmation_label=i18n['continue'].capitalize())
return watcher.request_confirmation(i18n['arch.missing_deps.title'], msg, [comp], confirmation_label=i18n['continue'].capitalize(), deny_label=i18n['cancel'].capitalize())
Loading

0 comments on commit 6bd27b5

Please sign in to comment.