summaryrefslogtreecommitdiff
path: root/lib/formats.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2010-05-28 12:18:26 +0300
committerPanu Matilainen <pmatilai@redhat.com>2010-05-28 12:18:26 +0300
commitac0ab016a5ec31e65eb0c0910a5a6f1199aae3e7 (patch)
treeae924c400d0f4affe86d1cfc0482eed0b6d61d0b /lib/formats.c
parenta6c8e490236bc373fcb565d30652f69218db2b84 (diff)
downloadrpm-ac0ab016a5ec31e65eb0c0910a5a6f1199aae3e7.tar.gz
rpm-ac0ab016a5ec31e65eb0c0910a5a6f1199aae3e7.tar.bz2
rpm-ac0ab016a5ec31e65eb0c0910a5a6f1199aae3e7.zip
Add internal helper for formatting verify flags
Diffstat (limited to 'lib/formats.c')
-rw-r--r--lib/formats.c26
1 files changed, 3 insertions, 23 deletions
diff --git a/lib/formats.c b/lib/formats.c
index 3113c8049..be8a83c05 100644
--- a/lib/formats.c
+++ b/lib/formats.c
@@ -15,6 +15,7 @@
#include "rpmio/digest.h"
#include "lib/manifest.h"
+#include "lib/misc.h"
#include "debug.h"
@@ -638,36 +639,15 @@ static char * fstateFormat(rpmtd td, char * formatPrefix)
static char * vflagsFormat(rpmtd td, char * formatPrefix)
{
char * val = NULL;
- char buf[15];
if (rpmtdClass(td) != RPM_NUMERIC_CLASS) {
val = xstrdup(_("(not a number)"));
} else {
- uint64_t vflags = rpmtdGetNumber(td);
- buf[0] = '\0';
- if (vflags & RPMVERIFY_FILEDIGEST)
- strcat(buf, "5");
- if (vflags & RPMVERIFY_FILESIZE)
- strcat(buf, "S");
- if (vflags & RPMVERIFY_LINKTO)
- strcat(buf, "L");
- if (vflags & RPMVERIFY_MTIME)
- strcat(buf, "T");
- if (vflags & RPMVERIFY_RDEV)
- strcat(buf, "D");
- if (vflags & RPMVERIFY_USER)
- strcat(buf, "U");
- if (vflags & RPMVERIFY_GROUP)
- strcat(buf, "G");
- if (vflags & RPMVERIFY_MODE)
- strcat(buf, "M");
- if (vflags & RPMVERIFY_CAPS)
- strcat(buf, "P");
-
strcat(formatPrefix, "s");
+ char *buf = rpmVerifyString(rpmtdGetNumber(td), "");
rasprintf(&val, formatPrefix, buf);
+ buf = _free(buf);
}
-
return val;
}