[pacman-dev] [PATCH] pactree: Add support for getting optional dependencies

Allan McRae allan at archlinux.org
Mon Apr 18 06:27:44 UTC 2016


On 01/03/16 22:00, Johannes Löthberg wrote:
> On 01/03, Andrew Gregory wrote:
>> On 02/25/16 at 10:44pm, Johannes Löthberg wrote:
>>> +static alpm_list_t *get_pkg_optdep_names(alpm_pkg_t *pkg)
>>> +{
>>> +    alpm_list_t *i = NULL, *names = NULL;
>>> +    for(i = alpm_pkg_get_optdepends(pkg); i; i = alpm_list_next(i)) {
>>> +        alpm_depend_t *d = i->data;
>>> +        if(searchsyncs) {
>>> +            names = alpm_list_add(names, d->name);
>>> +        } else {
>>> +            alpm_db_t *localdb = alpm_get_localdb(handle);
>>> +            if(alpm_find_satisfier(alpm_db_get_pkgcache(localdb),
>>> d->name)) {
>>> +                names = alpm_list_add(names, d->name);
>>> +            }
>>
>> Why does this hide uninstalled optdepends?  We don't hide uninstalled
>> dependencies and I don't see any reason to treat them differently.
>>
> 
> It felt cleaner since when you want to get the list of dependencies and
> optdeps from the local DB you probably don't care about uninstalled
> ones, but uninstalled dependencies shouldn't really be hidden since it
> shows that something is likely wrong.
> 
> But I guess I could remove it and have people that want the more useful
> output remove those lines themselves...

Can we flag dependencies (either dep or optdep) as installed?

Also, what happens if the optdepends is a provider?  Is it printed as
"foo provides bar" like in the dependency case?

A


More information about the pacman-dev mailing list