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

Johannes Löthberg johannes at kyriasis.com
Tue Mar 1 12:00:08 UTC 2016


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...


-- 
Sincerely,
  Johannes Löthberg
  PGP Key ID: 0x50FB9B273A9D0BB5
  https://theos.kyriasis.com/~kyrias/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 1768 bytes
Desc: not available
URL: <https://lists.archlinux.org/pipermail/pacman-dev/attachments/20160301/b0c4b0a9/attachment.asc>


More information about the pacman-dev mailing list