[arch] fix -> upgrade: crashing during the dependency breakage checking if AUR packages dependents cannot be found

This commit is contained in:
Vinicius Moreira
2020-09-02 09:36:07 -03:00
parent feb061efa4
commit b4b5dd3f6f

View File

@@ -918,9 +918,9 @@ def map_required_by(names: Iterable[str] = None, remote: bool = False) -> Dict[s
output = run_cmd('pacman -{} {}'.format('Sii' if remote else 'Qi', ' '.join(names) if names else ''), print_error=False) output = run_cmd('pacman -{} {}'.format('Sii' if remote else 'Qi', ' '.join(names) if names else ''), print_error=False)
if output: if output:
res = {}
latest_name, required = None, None latest_name, required = None, None
res = {}
for l in output.split('\n'): for l in output.split('\n'):
if l: if l:
if l[0] != ' ': if l[0] != ' ':
@@ -943,8 +943,11 @@ def map_required_by(names: Iterable[str] = None, remote: bool = False) -> Dict[s
elif latest_name and required is not None: elif latest_name and required is not None:
required.update(required.update((d for d in l.strip().split(' ') if d))) required.update(required.update((d for d in l.strip().split(' ') if d)))
return res return res
elif names:
return {n: set() for n in names}
else:
return {}
def map_conflicts_with(names: Iterable[str], remote: bool) -> Dict[str, Set[str]]: def map_conflicts_with(names: Iterable[str], remote: bool) -> Dict[str, Set[str]]: