[PATCH opkg] libopkg: pkg_hash: print unresolved dependencies

Hauke Mehrtens hauke at hauke-m.de
Mon May 3 18:46:22 BST 2021


On 5/3/21 2:38 PM, Baptiste Jonglez wrote:
> Hi,
> 
> On 02-05-21, Hauke Mehrtens wrote:
>> When a package is not installed because it has unresolved dependencies
>> normally we get only an error message like this:
>>   * pkg_hash_fetch_best_installation_candidate: Packages for ltq-vdsl-app found, but incompatible with the architectures configured
>>   * opkg_install_cmd: Cannot install package ltq-vdsl-app.
>>
>> Log in addition the following error message:
>>   * pkg_hash_check_unresolved: can not find dependency ltq-dsl-base for ltq-vdsl-app
> 
> Since the error has probably nothing to do with "architectures", wouldn't
> it make more sense to remove or improve the first error message?  Or
> understand why it fails for seemingly unrelated reasons.

This "incompatible with the architectures configured" error message is 
shown for more error cases than the newly added one, see here:
https://lxr.openwrt.org/source/opkg-lede/libopkg/pkg_hash.c#L395

It would probably be good to improve the error messages, but I do not 
understand the full code. If someone has some suggestions on how to 
improve this it would be nice.

>> Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
>> ---
>>
>> I am not sure if this would happen in normal cases too and spam the
>> error log, I only saw this in an error case.
>>
>>   libopkg/pkg_hash.c | 4 +++-
>>   1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/libopkg/pkg_hash.c b/libopkg/pkg_hash.c
>> index a07a25e..6c04ab2 100644
>> --- a/libopkg/pkg_hash.c
>> +++ b/libopkg/pkg_hash.c
>> @@ -263,8 +263,10 @@ pkg_hash_check_unresolved(pkg_t *maybe)
>>   	if (unresolved) {
>>   		res = 1;
>>   		tmp = unresolved;
>> -		while (*tmp)
>> +		while (*tmp) {
>> +			opkg_msg(ERROR, "can not find dependency %s for %s\n", *tmp, maybe->name);
>>   			free(*(tmp++));
>> +		}
>>   		free(unresolved);
>>   	}
>>   	pkg_vec_free(depends);

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_0x93DD20630910B515.asc
Type: application/pgp-keys
Size: 9895 bytes
Desc: OpenPGP public key
URL: <http://lists.openwrt.org/pipermail/openwrt-devel/attachments/20210503/efc9b3ae/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.openwrt.org/pipermail/openwrt-devel/attachments/20210503/efc9b3ae/attachment.sig>


More information about the openwrt-devel mailing list