summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJo-Philipp Wich2018-10-30 09:25:11 +0000
committerJo-Philipp Wich2018-10-30 09:42:47 +0000
commite3d73300bd7bd6d02d00e862bccc66e27449a0c9 (patch)
tree62f29fd1260f8bc6503af66d99ac732a5f49ddfd
parent3b417b9f41b4ceb5912d82f867dd5534e5675b5c (diff)
downloadopkg-lede-e3d73300bd7bd6d02d00e862bccc66e27449a0c9.tar.gz
libopkg: don't print unresolved dependencies twice
Sometimes opkg ends up reporting unresolved dependencies multiple times while also missing a newline between consecutive error lines, making the error message output looking garbled and confusing. Add some logic to skip repeated unresolved dependencies and ensure that message lines are properly terminated by newlines. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r--libopkg/opkg_install.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/libopkg/opkg_install.c b/libopkg/opkg_install.c
index e6f8a1b..d2d919a 100644
--- a/libopkg/opkg_install.c
+++ b/libopkg/opkg_install.c
@@ -45,7 +45,7 @@ static int satisfy_dependencies_for(pkg_t * pkg)
int i, err;
pkg_vec_t *depends = pkg_vec_alloc();
pkg_t *dep;
- char **tmp, **unresolved = NULL;
+ char **tmp, **unresolved = NULL, *prev = NULL;
int ndepends;
ndepends = pkg_hash_fetch_unsatisfied_dependencies(pkg, depends,
@@ -57,12 +57,17 @@ static int satisfy_dependencies_for(pkg_t * pkg)
pkg->name);
tmp = unresolved;
while (*unresolved) {
- opkg_message(ERROR, "\t%s", *unresolved);
+ if (!prev || strcmp(*unresolved, prev))
+ opkg_message(ERROR, "\t%s\n", *unresolved);
+ prev = *unresolved;
+ unresolved++;
+ }
+ unresolved = tmp;
+ while (*unresolved) {
free(*unresolved);
unresolved++;
}
free(tmp);
- opkg_message(ERROR, "\n");
if (!conf->force_depends) {
opkg_msg(INFO,
"This could mean that your package list is out of date or that the packages\n"