From a099ff189a15965142f1221988f9e28f7840f09d Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Wed, 17 Aug 2011 15:15:03 -0400 Subject: add %h formatter for sha256sum --- README.pod | 2 ++ expac.c | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.pod b/README.pod index 91602d7..5d74b4e 100644 --- a/README.pod +++ b/README.pod @@ -108,6 +108,8 @@ The format argument allows the following interpreted sequences: %g base64 encoded PGP signature (only with -S) + %h sha256sum + %i has install scriptlet (only with -Q) %k download size (only with -S) diff --git a/expac.c b/expac.c index 1297c49..9bf24f4 100644 --- a/expac.c +++ b/expac.c @@ -37,7 +37,7 @@ #define DEFAULT_DELIM "\n" #define DEFAULT_LISTDELIM " " #define DEFAULT_TIMEFMT "%c" -#define FORMAT_TOKENS "BCDEGLNOPRSabdmnprsuvw%" +#define FORMAT_TOKENS "BCDEGLNOPRSabdhmnprsuvw%" #define FORMAT_TOKENS_LOCAL "ilFw" #define FORMAT_TOKENS_SYNC "fgk" #define ESCAPE_TOKENS "\"\\abefnrtv" @@ -424,6 +424,9 @@ static int print_pkg(alpm_pkg_t *pkg, const char *format) { case 'g': /* base64 gpg sig */ out += printf(fmt, alpm_pkg_get_base64_sig(pkg)); break; + case 'h': /* sha256sum */ + out += printf(fmt, alpm_pkg_get_sha256sum(pkg)); + break; /* times */ case 'b': /* build date */ -- cgit v1.2.3-70-g09d2