return val;
}
+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");
+ rasprintf(&val, formatPrefix, buf);
+ }
+
+ return val;
+}
void *rpmHeaderFormatFuncByName(const char *fmt)
{
const struct headerFormatFunc_s * ext;
{ RPMTD_FORMAT_SHESCAPE, "shescape", shescapeFormat },
{ RPMTD_FORMAT_ARRAYSIZE, "arraysize", arraysizeFormat },
{ RPMTD_FORMAT_FSTATE, "fstate", fstateFormat },
+ { RPMTD_FORMAT_VFLAGS, "vflags", vflagsFormat },
{ -1, NULL, NULL }
};
RPMTD_FORMAT_ARRAYSIZE = 14, /* size of contained array (any type) */
RPMTD_FORMAT_DEPTYPE = 15, /* dependency types (int types) */
RPMTD_FORMAT_FSTATE = 16, /* file states (int types) */
+ RPMTD_FORMAT_VFLAGS = 17, /* file verify flags (int types) */
} rpmtdFormats;
/** \ingroup rpmtd