From 9a1ab8e6fcead217ae543ee4e43b3b39d7767509 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Sun, 8 Feb 2009 19:20:32 +0000 Subject: info: list contents follw same style as list depends - empty lines comes after not before - separate pkgname with : when using -v option --- src/info.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/info.c') diff --git a/src/info.c b/src/info.c index e9d209e..7bfc6b7 100644 --- a/src/info.c +++ b/src/info.c @@ -94,15 +94,19 @@ static void info_print_contents(struct apk_package *pkg) struct apk_db_file *file; struct hlist_node *dc, *dn, *fc, *fn; + if (apk_verbosity == 1) + printf("%s-%s contains:\n", pkg->name->name, pkg->version); + hlist_for_each_entry_safe(diri, dc, dn, &pkg->owned_dirs, pkg_dirs_list) { hlist_for_each_entry_safe(file, fc, fn, &diri->owned_files, diri_files_list) { if (apk_verbosity > 1) - printf("%s ", pkg->name->name); + printf("%s: ", pkg->name->name); printf("%s/%s\n", diri->dir->dirname, file->filename); } } + puts(""); } static int info_contents(struct apk_database *db, int argc, char **argv) @@ -118,11 +122,8 @@ static int info_contents(struct apk_database *db, int argc, char **argv) } for (j = 0; j < name->pkgs->num; j++) { struct apk_package *pkg = name->pkgs->item[j]; - if (apk_verbosity == 1 - && apk_pkg_get_state(pkg) == APK_STATE_INSTALL) - printf("\n%s-%s contains:\n", pkg->name->name, - pkg->version); - info_print_contents(name->pkgs->item[j]); + if (apk_pkg_get_state(pkg) == APK_STATE_INSTALL) + info_print_contents(pkg); } } return 0; -- cgit v1.2.3-60-g2f50