summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2010-06-08 10:24:21 +0300
committerTimo Teräs <timo.teras@iki.fi>2010-06-08 10:24:21 +0300
commitefe90d43c8de624f771d726d8412bfbc30002afa (patch)
treefcc182e43257e40183b8e2d4ea024e9c359d5db9
parentf85d87e5f9d0572bbb04ecb9aaad47f9c15b1703 (diff)
downloadapk-tools-efe90d43c8de624f771d726d8412bfbc30002afa.tar.gz
apk-tools-efe90d43c8de624f771d726d8412bfbc30002afa.tar.bz2
apk-tools-efe90d43c8de624f771d726d8412bfbc30002afa.tar.xz
apk-tools-efe90d43c8de624f771d726d8412bfbc30002afa.zip
state: fix error printing
-rw-r--r--src/apk.c2
-rw-r--r--src/state.c6
2 files changed, 6 insertions, 2 deletions
diff --git a/src/apk.c b/src/apk.c
index 76c1e4e..2273fa4 100644
--- a/src/apk.c
+++ b/src/apk.c
@@ -105,6 +105,8 @@ int apk_print_indented(struct apk_indent *i, apk_blob_t blob)
if (i->x + blob.len + 1 >= wrap_length) {
i->x = i->indent;
printf("\n%*s", i->indent - 1, "");
+ } else if (i->x+1 < i->indent) {
+ printf("%*s", i->indent - i->x - 1, "");
}
i->x += printf(" %.*s", blob.len, blob.ptr);
return 0;
diff --git a/src/state.c b/src/state.c
index 4dd9c5b..178e4c9 100644
--- a/src/state.c
+++ b/src/state.c
@@ -41,7 +41,7 @@ static void apk_state_record_conflict(struct apk_state *state,
{
struct apk_name *name = pkg->name;
- state->name[name->id] = (void*) (((intptr_t)state->name[name->id]) | APK_NS_ERROR);
+ state->name[name->id] = (void*) (((intptr_t) pkg) | APK_NS_ERROR | APK_NS_LOCKED);
*apk_package_array_add(&state->conflicts) = pkg;
}
@@ -314,6 +314,7 @@ int apk_state_prune_dependency(struct apk_state *state,
}
if (c->num <= 1) {
name_choices_unref(c);
+ state->name[name->id] = ns_from_pkg(NULL);
return -1;
}
@@ -830,8 +831,9 @@ void apk_state_print_errors(struct apk_state *state)
apk_error("Unable to satisfy all dependencies:");
es.prevpkg = pkg = state->conflicts->item[i];
- es.indent.x = es.indent.indent =
+ es.indent.x =
printf(" %s-%s:", pkg->name->name, pkg->version);
+ es.indent.indent = es.indent.x + 1;
for (j = 0; j < pkg->depends->num; j++) {
r = apk_state_lock_dependency(state,
&pkg->depends->item[j]);