From 4593ace7ab121f025c71bb0b1bb2a21694896354 Mon Sep 17 00:00:00 2001 From: karasu Date: Sat, 28 Apr 2018 14:45:08 +0200 Subject: [PATCH] Do not crash when searching for missing groups in Antergos repository database --- src/download/metalink.py | 4 +--- src/pacman/pac.py | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/download/metalink.py b/src/download/metalink.py index 8adcda0c9..d71a48168 100644 --- a/src/download/metalink.py +++ b/src/download/metalink.py @@ -330,10 +330,8 @@ def build_download_queue(alpm, args=None): antdb = [db for db in handle.get_syncdbs() if 'antergos' == db.name] antdb = antdb[0] + one_repo_groups_names = ['cinnamon', 'mate', 'mate-extra'] - - #one_repo_groups = [antdb.read_grp(one_repo_group) - # for one_repo_group in one_repo_groups_names] one_repo_groups = [] for one_repo_group_name in one_repo_groups_names: grp = antdb.read_grp(one_repo_group_name) diff --git a/src/pacman/pac.py b/src/pacman/pac.py index 2fd025773..570368ecb 100644 --- a/src/pacman/pac.py +++ b/src/pacman/pac.py @@ -266,13 +266,22 @@ def install(self, pkgs, conflicts=None, options=None): # have to ensure we don't clobber the priority of the repos. repos = OrderedDict() repo_order = [] - one_repo_groups = ['cinnamon', 'mate', 'mate-extra'] db_match = [db for db in self.handle.get_syncdbs() if 'antergos' == db.name] antdb = OrderedDict() antdb['antergos'] = db_match[0] - one_repo_groups = [antdb['antergos'].read_grp(one_repo_group) - for one_repo_group in one_repo_groups] + + one_repo_groups_names = ['cinnamon', 'mate', 'mate-extra'] + one_repo_groups = [] + for one_repo_group_name in one_repo_groups_names: + grp = antdb['antergos'].read_grp(one_repo_group_name) + if not grp: + grp = ['None', []] + logging.warning( + "Error reading group '%s' from the antergos repo db", + one_repo_group_name) + one_repo_groups.append(grp) + one_repo_pkgs = {pkg for one_repo_group in one_repo_groups for pkg in one_repo_group[1] if one_repo_group}