forked from Mirror/pmbootstrap
pmb.helpers.apk: fix crash computing progress from apk3
Fixes: tot = float(cur_tot[1]) ^^^^^^^^^^^^^^^^^ ValueError: could not convert string to float: '5383561 download' Because this line now includes " download" at the end: ipdb> p line '10727/5383561 download\n' Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2635
This commit is contained in:
parent
a8988872b6
commit
f9add1b6d2
1 changed files with 1 additions and 1 deletions
|
@ -124,7 +124,7 @@ def _compute_progress(line: str) -> float:
|
|||
"""
|
||||
if not line:
|
||||
return 1
|
||||
cur_tot = line.rstrip().split("/")
|
||||
cur_tot = line.split(" ")[0].rstrip().split("/")
|
||||
if len(cur_tot) != 2:
|
||||
return 0
|
||||
cur = float(cur_tot[0])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue