From f9add1b6d29711a4a86d5ab6a7fe44e6eb6cb618 Mon Sep 17 00:00:00 2001 From: Clayton Craft Date: Tue, 1 Jul 2025 08:37:20 -0700 Subject: [PATCH] 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 --- pmb/helpers/apk.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pmb/helpers/apk.py b/pmb/helpers/apk.py index 4ca4de93..c932cffe 100644 --- a/pmb/helpers/apk.py +++ b/pmb/helpers/apk.py @@ -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])