mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-06 21:44:16 +02:00
[arch] fix -> multi-threaded download: crashing when could not retrieve download data for packages to upgrade
This commit is contained in:
@@ -13,7 +13,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
|
||||
### Fixes
|
||||
- Arch
|
||||
- crashing when trying to upgrade AUR packages which data could not be retrieved
|
||||
- crashing when trying to upgrade repository packages which data could not be retrieved
|
||||
- multi-threaded download: crashing when could not retrieve download data for packages to upgrade
|
||||
|
||||
- Installation setup
|
||||
- wrong style resources paths
|
||||
|
||||
@@ -160,6 +160,12 @@ class MultithreadedDownloadService:
|
||||
downloaded = 0
|
||||
pkgs_data = pacman.list_download_data(pkgs)
|
||||
|
||||
if not pkgs_data:
|
||||
error_msg = "Could not retrieve download data of the following packages: {}".format(', '.join(pkgs))
|
||||
watcher.print(error_msg)
|
||||
self.logger.error(error_msg)
|
||||
return 0
|
||||
|
||||
for pkg in pkgs_data:
|
||||
self.logger.info('Preparing to download package: {} ({})'.format(pkg['n'], pkg['v']))
|
||||
try:
|
||||
|
||||
@@ -599,8 +599,8 @@ def map_provided(remote: bool = False, pkgs: Iterable[str] = None) -> Dict[str,
|
||||
def list_download_data(pkgs: Iterable[str]) -> List[Dict[str, str]]:
|
||||
_, output = system.run(['pacman', '-Si', *pkgs])
|
||||
|
||||
res = []
|
||||
if output:
|
||||
res = []
|
||||
data = {'a': None, 'v': None, 'r': None, 'n': None}
|
||||
|
||||
for l in output.split('\n'):
|
||||
@@ -623,7 +623,7 @@ def list_download_data(pkgs: Iterable[str]) -> List[Dict[str, str]]:
|
||||
res.append(data)
|
||||
data = {'a': None, 'v': None, 'r': None, 'n': None}
|
||||
|
||||
return res
|
||||
return res
|
||||
|
||||
|
||||
def map_updates_data(pkgs: Iterable[str], files: bool = False) -> dict:
|
||||
|
||||
Reference in New Issue
Block a user