added :fflags format
authorewt <devnull@localhost>
Sun, 1 Sep 1996 16:54:43 +0000 (16:54 +0000)
committerewt <devnull@localhost>
Sun, 1 Sep 1996 16:54:43 +0000 (16:54 +0000)
CVS patchset: 1013
CVS date: 1996/09/01 16:54:43

query.c

diff --git a/query.c b/query.c
index 6a524fb..e6a001a 100644 (file)
--- a/query.c
+++ b/query.c
@@ -270,6 +270,15 @@ static char * handleFormat(Header h, char * chptr, int * cntptr,
            tstruct = localtime(&dateint);
            strftime(buf, sizeof(buf) - 1, "%c", tstruct);
            printf(format, buf);
+       } else if (!strcmp(how, "fflags")) {
+           strcat(format, "s");
+           buf[0] = '\0';
+           anint = *(((int_32 *) p) + arrayNum);
+           if (anint & RPMFILE_DOC)
+               strcat(buf, "d");
+           if (anint & RPMFILE_CONFIG)
+               strcat(buf, "c");
+           printf(format, buf);
        } else if (!strcmp(how, "perms") || !strcmp(how, "permissions")) {
            strcat(format, "s");
            printf(format, permsString(*(((int_32 *) p) + arrayNum)));