From 98c6b46de6d5074235e80617fd03c9e15cdd16e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Ter=C3=A4s?= Date: Tue, 18 Jun 2013 14:30:44 +0300 Subject: db: store repository tag names including leading @ --- src/commit.c | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) (limited to 'src/commit.c') diff --git a/src/commit.c b/src/commit.c index 01ac4a8acc..4c6e53a471 100644 --- a/src/commit.c +++ b/src/commit.c @@ -32,24 +32,13 @@ static int print_change(struct apk_database *db, struct apk_change *change, struct apk_package *oldpkg = change->old_pkg; struct apk_package *newpkg = change->new_pkg; const char *msg = NULL; - char status[32], n[512], *nameptr; + char status[32]; apk_blob_t *oneversion = NULL; int r; snprintf(status, sizeof(status), "(%i/%i)", cur+1, total); - status[sizeof(status) - 1] = 0; name = newpkg ? newpkg->name : oldpkg->name; - if (change->new_repository_tag > 0) { - snprintf(n, sizeof(n), "%s@" BLOB_FMT, - name->name, - BLOB_PRINTF(*db->repo_tags[change->new_repository_tag].name)); - n[sizeof(n) - 1] = 0; - nameptr = n; - } else { - nameptr = name->name; - } - if (oldpkg == NULL) { msg = "Installing"; oneversion = newpkg->version; @@ -84,12 +73,16 @@ static int print_change(struct apk_database *db, struct apk_change *change, return FALSE; if (oneversion) { - apk_message("%s %s %s (" BLOB_FMT ")", - status, msg, nameptr, + apk_message("%s %s %s" BLOB_FMT " (" BLOB_FMT ")", + status, msg, + name->name, + BLOB_PRINTF(db->repo_tags[change->new_repository_tag].tag), BLOB_PRINTF(*oneversion)); } else { - apk_message("%s %s %s (" BLOB_FMT " -> " BLOB_FMT ")", - status, msg, nameptr, + apk_message("%s %s %s" BLOB_FMT " (" BLOB_FMT " -> " BLOB_FMT ")", + status, msg, + name->name, + BLOB_PRINTF(db->repo_tags[change->new_repository_tag].tag), BLOB_PRINTF(*oldpkg->version), BLOB_PRINTF(*newpkg->version)); } @@ -383,7 +376,7 @@ static void print_pinning_errors(struct print_state *ps, struct apk_package *pkg for (i = 0; i < db->num_repo_tags; i++) { if (pkg->repos & db->repo_tags[i].allowed_repos) { label_start(ps, "masked in:"); - apk_print_indented(&ps->i, *db->repo_tags[i].name); + apk_print_indented(&ps->i, db->repo_tags[i].tag); } } label_end(ps); -- cgit v1.2.3