[fix][aur] optional dep install fails when it is based on another package

This commit is contained in:
Vinícius Moreira
2020-01-29 17:50:37 -03:00
parent c6a00ec2dd
commit 83fce04c5d
3 changed files with 17 additions and 2 deletions

View File

@@ -65,6 +65,20 @@ class AURClient:
if res and res.text:
return map_srcinfo(res.text)
self.logger.warning('No .SRCINFO found for {}'.format(name))
self.logger.info('Checking if {} is based on another package'.format(name))
# if was not found, it may be based on another package.
infos = self.get_info({name})
if infos:
info = infos[0]
info_name = info.get('Name')
info_base = info.get('PackageBase')
if info_name and info_base and info_name != info_base:
self.logger.info('{p} is based on {b}. Retrieving {b} .SRCINFO'.format(p=info_name, b=info_base))
return self.get_src_info(info_base)
def get_all_dependencies(self, name: str) -> Set[str]:
deps = set()
info = self.get_src_info(name)

View File

@@ -22,7 +22,7 @@ def request_optional_deps(pkgname: str, pkg_mirrors: dict, watcher: ProcessWatch
view_opts = MultipleSelectComponent(label='',
options=opts,
default_options=None)
default_options=set(opts))
install = watcher.request_confirmation(title=i18n['arch.install.optdeps.request.title'],
body='<p>{}.</p><p>{}:</p>'.format(i18n['arch.install.optdeps.request.body'].format(bold(pkgname)), i18n['arch.install.optdeps.request.help']),

View File

@@ -400,7 +400,8 @@ class ArchManager(SoftwareManager):
for dep in deps:
handler.watcher.change_substatus(self.i18n['arch.install.dependency.install'].format(bold('{} ()'.format(dep[0], dep[1]))))
if dep[1] == 'aur':
installed = self._install_from_aur(pkgname=dep[0], pkgbase=None, maintainer=None, root_password=root_password, handler=handler, dependency=True, change_progress=False)
pkgbase = self.aur_client.get_src_info(dep[0])['pkgbase']
installed = self._install_from_aur(pkgname=dep[0], pkgbase=pkgbase, maintainer=None, root_password=root_password, handler=handler, dependency=True, change_progress=False)
else:
installed = self._install(pkgname=dep[0], maintainer=None, root_password=root_password, handler=handler, install_file=None, mirror=dep[1], change_progress=False)