From bb57dc7095173afba08cca2826f12097ead55af8 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Sat, 21 Sep 2024 14:37:40 +0200 Subject: [PATCH] mambabase.py: refresh packages list before checking for installed packages to fix crash on first run --- mambabase/mambabase.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/mambabase/mambabase.py b/mambabase/mambabase.py index 1964e34..141b174 100755 --- a/mambabase/mambabase.py +++ b/mambabase/mambabase.py @@ -65,6 +65,19 @@ class PrepareThread(QtCore.QThread): def run(self): # Update packages list + self.updateProgressSignal.emit({ 'value': 5, + 'label': _("Updating packages list..."), + 'details': _("Updating packages list...")}) + result = subprocess.run(['pkcon', 'refresh'], + stdout=subprocess.PIPE, stderr=subprocess.PIPE) + if result.returncode == 0: + if result.stdout: + self.updateProgressSignal.emit({ + 'details': result.stdout.decode('UTF-8').replace('\n', '
')}) + else: + if result.stderr: + self.updateProgressSignal.emit({ + 'details': result.stderr.decode('UTF-8').replace('\n', '
')}) self.updateProgressSignal.emit({ 'value': 5, 'label': _("Checking installed packages...")}) self.parent.selectGroupsPage.loadPkgGroups()