unsigned int mtime, unsigned short rdev,
char * owner, char * group, int uid, int gid,
char * linkto);
+static void printScript(Header h, char * label, int tag);
static char * defaultQueryFormat =
"Name : %-27{NAME} Distribution: %{DISTRIBUTION}\n"
if (fileGroupList) free(fileGroupList);
}
}
+
+ if (queryFlags & QUERY_FOR_SCRIPTS) {
+ printScript(h, "preinstall script:\n", RPMTAG_PREIN);
+ printScript(h, "postinstall script:\n", RPMTAG_POSTIN);
+ printScript(h, "preuninstall script:\n", RPMTAG_PREUN);
+ printScript(h, "preuninstall script:\n", RPMTAG_POSTUN);
+ }
+ }
+}
+
+static void printScript(Header h, char * label, int tag) {
+ int type, count;
+ char * script;
+
+ if (getEntry(h, tag, &type, (void **) &script, &count)) {
+ printf("%s", label);
+ printf("%s\n", script);
}
}
QUERY_SPACKAGE, QUERY_RPM, QUERY_SRPM, QUERY_GROUP,
QUERY_SGROUP };
-#define QUERY_FOR_INFO 1
-#define QUERY_FOR_LIST 2
-#define QUERY_FOR_STATE 4
-#define QUERY_FOR_DOCS 8
-#define QUERY_FOR_CONFIG 16
+#define QUERY_FOR_INFO (1 << 0)
+#define QUERY_FOR_LIST (1 << 1)
+#define QUERY_FOR_STATE (1 << 2)
+#define QUERY_FOR_DOCS (1 << 3)
+#define QUERY_FOR_CONFIG (1 << 4)
+#define QUERY_FOR_SCRIPTS (1 << 5)
int doQuery(char * prefix, enum querysources source, int queryFlags,
char * arg, char * queryFormat);