aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Lepied <flepied@mandriva.com>2003-04-29 20:17:58 +0000
committerFrederic Lepied <flepied@mandriva.com>2003-04-29 20:17:58 +0000
commit4c8dbe1cca64706b683c50248ade694bec8b999a (patch)
tree315ef2a541d925564a568e42983d3e955323f2c6
parent4a7ff01c8d9072d0f2580eb29dc78b324b4b7588 (diff)
downloadrpmtools-4c8dbe1cca64706b683c50248ade694bec8b999a.tar
rpmtools-4c8dbe1cca64706b683c50248ade694bec8b999a.tar.gz
rpmtools-4c8dbe1cca64706b683c50248ade694bec8b999a.tar.bz2
rpmtools-4c8dbe1cca64706b683c50248ade694bec8b999a.tar.xz
rpmtools-4c8dbe1cca64706b683c50248ade694bec8b999a.zip
added rpm 4.2 support
-rw-r--r--rpm2header.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/rpm2header.c b/rpm2header.c
index 554b8bd..1dd3ab9 100644
--- a/rpm2header.c
+++ b/rpm2header.c
@@ -7,6 +7,10 @@
#include <unistd.h>
#include <rpmlib.h>
+#ifdef RPM_42
+#include <rpm/rpmts.h>
+#endif
+
#define FILENAME_TAG 1000000
#define FILESIZE_TAG 1000001
@@ -35,9 +39,14 @@ int main(int argc, char **argv) {
for (i = 1; i < argc; i++) {
FD_t fd;
Header h;
- int isSource;
int_32 size;
const char *name = basename(argv[i]);
+#ifdef RPM_42
+ rpmts ts;
+ /* rpmVSFlags vsflags, ovsflags; */
+#else
+ int isSource;
+#endif
fprintf(stderr, "%s\n", argv[i]);
@@ -47,7 +56,13 @@ int main(int argc, char **argv) {
}
size = FD_size(fd);
+#ifdef RPM_42
+ ts = rpmtsCreate();
+ rpmtsSetVSFlags(ts, _RPMVSF_NOSIGNATURES);
+ if (rpmReadPackageFile(ts, fd, argv[1], &h) == 0) {
+#else
if (rpmReadPackageHeader(fd, &h, &isSource, NULL, NULL) == 0) {
+#endif
headerRemoveEntry(h, RPMTAG_POSTIN);
headerRemoveEntry(h, RPMTAG_POSTUN);
headerRemoveEntry(h, RPMTAG_PREIN);