diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2009-02-08 19:20:32 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2009-02-08 19:22:04 +0000 |
commit | 9a1ab8e6fcead217ae543ee4e43b3b39d7767509 (patch) | |
tree | bca97f4de931bc277fd12c4f9087d8e555401902 | |
parent | f16b671edcead7cbac0e9d6b7459b6162a66a03a (diff) | |
download | apk-tools-9a1ab8e6fcead217ae543ee4e43b3b39d7767509.tar.bz2 apk-tools-9a1ab8e6fcead217ae543ee4e43b3b39d7767509.tar.xz |
info: list contents follw same style as list depends
- empty lines comes after not before
- separate pkgname with : when using -v option
-rw-r--r-- | src/info.c | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -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; |