mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 00:04:15 +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
|
### Fixes
|
||||||
- Arch
|
- 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
|
- Installation setup
|
||||||
- wrong style resources paths
|
- wrong style resources paths
|
||||||
|
|||||||
@@ -160,6 +160,12 @@ class MultithreadedDownloadService:
|
|||||||
downloaded = 0
|
downloaded = 0
|
||||||
pkgs_data = pacman.list_download_data(pkgs)
|
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:
|
for pkg in pkgs_data:
|
||||||
self.logger.info('Preparing to download package: {} ({})'.format(pkg['n'], pkg['v']))
|
self.logger.info('Preparing to download package: {} ({})'.format(pkg['n'], pkg['v']))
|
||||||
try:
|
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]]:
|
def list_download_data(pkgs: Iterable[str]) -> List[Dict[str, str]]:
|
||||||
_, output = system.run(['pacman', '-Si', *pkgs])
|
_, output = system.run(['pacman', '-Si', *pkgs])
|
||||||
|
|
||||||
|
res = []
|
||||||
if output:
|
if output:
|
||||||
res = []
|
|
||||||
data = {'a': None, 'v': None, 'r': None, 'n': None}
|
data = {'a': None, 'v': None, 'r': None, 'n': None}
|
||||||
|
|
||||||
for l in output.split('\n'):
|
for l in output.split('\n'):
|
||||||
@@ -623,7 +623,7 @@ def list_download_data(pkgs: Iterable[str]) -> List[Dict[str, str]]:
|
|||||||
res.append(data)
|
res.append(data)
|
||||||
data = {'a': None, 'v': None, 'r': None, 'n': None}
|
data = {'a': None, 'v': None, 'r': None, 'n': None}
|
||||||
|
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
|
||||||
def map_updates_data(pkgs: Iterable[str], files: bool = False) -> dict:
|
def map_updates_data(pkgs: Iterable[str], files: bool = False) -> dict:
|
||||||
|
|||||||
Reference in New Issue
Block a user