]>
Commit | Line | Data |
---|---|---|
a78ce0f6 JR |
1 | diff --git a/configure.ac b/configure.ac |
2 | index 192a838..4ddd127 100644 | |
3 | --- a/configure.ac | |
4 | +++ b/configure.ac | |
5 | @@ -200,12 +200,11 @@ AC_CHECK_LIB(bz2, BZ2_decompress, | |
6 | AM_CONDITIONAL(HAVE_BZ2, false))], | |
7 | AM_CONDITIONAL(HAVE_BZ2, false)) | |
8 | ||
9 | -AC_CHECK_LIB(rpm, rpmReadPackageFile, | |
10 | - [AC_CHECK_HEADERS([rpm/rpmlib.h], | |
11 | - AM_CONDITIONAL(HAVE_LIBRPM, true) | |
12 | - AC_DEFINE(HAVE_LIBRPM,1,[Have librpm]), | |
13 | - AM_CONDITIONAL(HAVE_LIBRPM, false))], | |
14 | - AM_CONDITIONAL(HAVE_LIBRPM, false)) | |
15 | +PKG_CHECK_MODULES(RPM, rpm, | |
16 | + AM_CONDITIONAL(HAVE_LIBRPM, true) | |
17 | + AC_DEFINE([HAVE_LIBRPM],[1], "RPM..."), | |
18 | + AM_CONDITIONAL(HAVE_LIBRPM, false) | |
19 | + ) | |
20 | ||
21 | AC_CHECK_LIB(mpeg2, mpeg2_init, | |
22 | [AC_CHECK_HEADERS([mpeg2dec/mpeg2.h], | |
23 | diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am | |
24 | index b3dd1de..7201699 100644 | |
25 | --- a/src/plugins/Makefile.am | |
26 | +++ b/src/plugins/Makefile.am | |
27 | @@ -1,4 +1,4 @@ | |
28 | -INCLUDES = -I$(top_srcdir)/src/include -I$(top_srcdir)/src/common | |
29 | +INCLUDES = -I$(top_srcdir)/src/include -I$(top_srcdir)/src/common $(RPM_CFLAGS) | |
30 | ||
31 | # install plugins under: | |
32 | plugindir = $(libdir)/@RPLUGINDIR@ | |
33 | diff --git a/src/plugins/rpm_extractor.c b/src/plugins/rpm_extractor.c | |
34 | index f8ed431..157af07 100644 | |
35 | --- a/src/plugins/rpm_extractor.c | |
36 | +++ b/src/plugins/rpm_extractor.c | |
37 | @@ -21,9 +21,12 @@ | |
38 | #include "platform.h" | |
39 | #include "extractor.h" | |
40 | #include <stdint.h> | |
41 | -#include <rpm/rpmlib.h> | |
42 | -#include <rpm/rpmts.h> | |
43 | -#include <rpm/rpmlog.h> | |
44 | +#include <rpmcli.h> | |
45 | +#include <rpmcli.h> | |
46 | +#include <rpmio.h> | |
47 | +#include <rpmtag.h> | |
48 | +#include <rpmts.h> | |
49 | +#include <rpmlog.h> | |
50 | #include <pthread.h> | |
51 | #include <sys/types.h> | |
52 | #include <signal.h> | |
53 | @@ -170,7 +173,7 @@ EXTRACTOR_rpm_extract (const char *data, | |
54 | const char *str; | |
55 | Header hdr; | |
56 | HeaderIterator hi; | |
57 | - rpmtd p; | |
58 | + HE_t p; | |
59 | int i; | |
60 | FD_t fdi; | |
61 | rpmRC rc; | |
62 | @@ -218,33 +221,42 @@ EXTRACTOR_rpm_extract (const char *data, | |
63 | "application/x-rpm", | |
64 | strlen ("application/x-rpm") +1)) | |
65 | return 1; | |
66 | - hi = headerInitIterator (hdr); | |
67 | - p = rpmtdNew (); | |
68 | - while (1 == headerNext (hi, p)) | |
69 | + hi = headerInit(hdr); | |
70 | + p = (HE_t)memset(alloca(sizeof(*p)), 0, sizeof(*p)); | |
71 | + while (1 == headerNext (hi, p, 0)) | |
72 | { | |
73 | i = 0; | |
74 | while (tests[i].rtype != 0) | |
75 | { | |
76 | if (tests[i].rtype == p->tag) | |
77 | { | |
78 | - switch (p->type) | |
79 | + switch (p->t) | |
80 | { | |
81 | case RPM_STRING_ARRAY_TYPE: | |
82 | + if (0 != proc (proc_cls, | |
83 | + "rpm", | |
84 | + tests[i].type, | |
85 | + EXTRACTOR_METAFORMAT_UTF8, | |
86 | + "text/plain", | |
87 | + p->p.str, | |
88 | + strlen (p->p.str) +1)) | |
89 | + return 1; | |
90 | + break; | |
91 | case RPM_I18NSTRING_TYPE: | |
92 | case RPM_STRING_TYPE: | |
93 | - while (NULL != (str = rpmtdNextString (p))) | |
94 | + for(p->ix = 0; p->ix < p->c; p->ix++) | |
95 | { | |
96 | if (0 != proc (proc_cls, | |
97 | "rpm", | |
98 | tests[i].type, | |
99 | EXTRACTOR_METAFORMAT_UTF8, | |
100 | "text/plain", | |
101 | - str, | |
102 | - strlen (str) +1)) | |
103 | + p->p.argv[p->ix], | |
104 | + strlen (p->p.argv[p->ix]) +1)) | |
105 | return 1; | |
106 | } | |
107 | break; | |
108 | - case RPM_INT32_TYPE: | |
109 | + case RPM_UINT32_TYPE: | |
110 | { | |
111 | if (p->tag == RPMTAG_BUILDTIME) | |
112 | { |