From 46c2693468bfa6d4de8236e5594eb47f82d81c44 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Sat, 27 May 2017 20:55:12 +0000 Subject: manifest: dump checksum type too --- src/manifest.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/manifest.c b/src/manifest.c index cf122af..ac86936 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -18,6 +18,10 @@ #include "apk_print.h" /* TODO: support package files as well as generating manifest from the installed DB. */ +static char *csum_types[APK_CHECKSUM_SHA1 + 1] = { + [APK_CHECKSUM_MD5] = "md5", + [APK_CHECKSUM_SHA1] = "sha1", +}; static void process_package(struct apk_database *db, struct apk_package *pkg) { @@ -42,7 +46,7 @@ static void process_package(struct apk_database *db, struct apk_package *pkg) if (apk_verbosity > 1) printf("%s: ", pkg->name->name); - printf("%s " DIR_FILE_FMT "\n", csum_buf, DIR_FILE_PRINTF(diri->dir, file)); + printf("%s:%s " DIR_FILE_FMT "\n", csum_types[file->csum.type], csum_buf, DIR_FILE_PRINTF(diri->dir, file)); } } } -- cgit v1.2.3-70-g09d2