summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-02-08 19:20:32 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-02-08 19:22:04 +0000
commit9a1ab8e6fcead217ae543ee4e43b3b39d7767509 (patch)
treebca97f4de931bc277fd12c4f9087d8e555401902
parentf16b671edcead7cbac0e9d6b7459b6162a66a03a (diff)
downloadapk-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.c13
1 files changed, 7 insertions, 6 deletions
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;