[arch] fix: displaying '?' instead of '0' for dependency sizes

This commit is contained in:
Vinicius Moreira
2022-03-28 15:53:36 -03:00
parent eb7347dbea
commit ba9c61db4e
3 changed files with 4 additions and 3 deletions

View File

@@ -24,6 +24,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Fixes ### Fixes
- Arch - Arch
- regression: not displaying ignored updates - regression: not displaying ignored updates
- dependency size: display a '?' instead of '0' ('?' should only be displayed when the size is unknown)
- Debian - Debian
- packages descriptions are not displayed on the system's default language (when available) - packages descriptions are not displayed on the system's default language (when available)

View File

@@ -26,7 +26,7 @@ def request_optional_deps(pkgname: str, pkg_repos: dict, watcher: ProcessWatcher
i18n['repository'], i18n['repository'],
d['repository'].lower(), d['repository'].lower(),
i18n['size'].capitalize(), i18n['size'].capitalize(),
get_human_size_str(size) if size else '?'), p) get_human_size_str(size) if size is not None else '?'), p)
op.icon_path = _get_repo_icon(d['repository']) op.icon_path = _get_repo_icon(d['repository'])
opts.append(op) opts.append(op)
@@ -58,7 +58,7 @@ def request_install_missing_deps(pkgname: Optional[str], deps: List[Tuple[str, s
i18n['repository'], i18n['repository'],
dep[1].lower(), dep[1].lower(),
i18n['size'].capitalize(), i18n['size'].capitalize(),
get_human_size_str(size) if size else '?'), dep[0]) get_human_size_str(size) if size is not None else '?'), dep[0])
op.read_only = True op.read_only = True
op.icon_path = _get_repo_icon(dep[1]) op.icon_path = _get_repo_icon(dep[1])
opts.append(op) opts.append(op)

View File

@@ -335,7 +335,7 @@ class UpdatesSummarizer:
current_size = installed_sizes.get(pkg.name) if installed_sizes else None current_size = installed_sizes.get(pkg.name) if installed_sizes else None
if current_size is not None and pkgdata['s']: if current_size is not None and pkgdata['s'] is not None:
requirement.extra_size = pkgdata['s'] - current_size requirement.extra_size = pkgdata['s'] - current_size
required_by = set() required_by = set()