diff mbox series

[v2] libopkg: pkg_hash: print unresolved dependencies

Message ID 20210608194840.470214-1-hauke@hauke-m.de
State Accepted
Delegated to: Hauke Mehrtens
Headers show
Series [v2] libopkg: pkg_hash: print unresolved dependencies | expand

Commit Message

Hauke Mehrtens June 8, 2021, 7:48 p.m. UTC
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: cannot find dependency ltq-dsl-base for ltq-vdsl-app

Signed-off-by: Hauke Mehrtens <hauke@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.

Could some expert on opkg please give me an Acked-by or some
suggestion to improve this.
I would also like to merge this into 21.02.

Changes since
v1:
 * can not -> cannot

 libopkg/pkg_hash.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Sven Roederer June 9, 2021, 10:41 p.m. UTC | #1
Am Dienstag, 8. Juni 2021, 21:48:40 CEST schrieb Hauke Mehrtens:
> 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: cannot find dependency ltq-dsl-base for
> ltq-vdsl-app
> 
> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
> ---


Hauke,

might be worth to mention in the commitmessage that this closes  FS#3814.

Best Sven
diff mbox series

Patch

diff --git a/libopkg/pkg_hash.c b/libopkg/pkg_hash.c
index a07a25e..c58703f 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, "cannot find dependency %s for %s\n", *tmp, maybe->name);
 			free(*(tmp++));
+		}
 		free(unresolved);
 	}
 	pkg_vec_free(depends);