]>
Commit | Line | Data |
---|---|---|
eb85e3be JB |
1 | --- createrepo_c/src/misc.c.orig 2013-12-01 15:00:42.000000000 +0100 |
2 | +++ createrepo_c/src/misc.c 2013-12-01 16:18:48.713931227 +0100 | |
3 | @@ -30,7 +30,7 @@ | |
4 | #include <ftw.h> | |
5 | #include <time.h> | |
6 | #include <curl/curl.h> | |
7 | -#include <rpm/rpmlib.h> | |
8 | +#include <rpm/rpmevr.h> | |
9 | #include "error.h" | |
10 | #include "misc.h" | |
11 | ||
12 | --- createrepo_c/CMakeLists.txt.orig 2013-12-01 15:00:42.000000000 +0100 | |
13 | +++ createrepo_c/CMakeLists.txt 2013-12-01 16:21:27.510591230 +0100 | |
14 | @@ -39,7 +39,7 @@ | |
15 | ||
16 | include_directories(${GLIB2_INCLUDE_DIRS}) | |
17 | include_directories(${LIBXML2_INCLUDE_DIR}) | |
18 | - | |
19 | +include_directories("/usr/include/rpm") | |
20 | ||
21 | # rpm: | |
22 | ||
23 | --- createrepo_c/src/parsehdr.h.orig 2013-12-01 15:00:42.000000000 +0100 | |
24 | +++ createrepo_c/src/parsehdr.h 2013-12-01 16:55:23.000505810 +0100 | |
25 | @@ -24,7 +24,7 @@ | |
26 | extern "C" { | |
27 | #endif | |
28 | ||
29 | -#include <rpm/rpmlib.h> | |
30 | +#include <rpm/rpmtag.h> | |
31 | #include <glib.h> | |
32 | #include "package.h" | |
33 | #include "xml_dump.h" | |
34 | --- createrepo_c/src/parsehdr.c.orig 2013-12-01 15:00:42.000000000 +0100 | |
35 | +++ createrepo_c/src/parsehdr.c 2013-12-01 16:33:26.753894379 +0100 | |
36 | @@ -19,6 +19,7 @@ | |
37 | ||
38 | #include <glib.h> | |
39 | #include <assert.h> | |
40 | +#include <rpm/rpm46compat.h> | |
41 | #include <rpm/rpmfi.h> | |
42 | #include <stdlib.h> | |
43 | #include "parsehdr.h" | |
44 | @@ -26,6 +27,76 @@ | |
45 | #include "misc.h" | |
46 | ||
47 | ||
48 | +static inline void* rpmtdNew(void) | |
49 | +{ | |
50 | + return malloc(sizeof(struct rpmtd_s)); | |
51 | +} | |
52 | + | |
53 | +static inline void rpmtdFree(rpmtd td) | |
54 | +{ | |
55 | + return free(td); | |
56 | +} | |
57 | + | |
58 | +static inline void rpmtdInit(rpmtd td) | |
59 | +{ | |
60 | + rpmtdReset(td); | |
61 | +} | |
62 | + | |
63 | +static inline const char * headerGetString(Header h, int32_t tag) | |
64 | +{ | |
65 | + const char *res = NULL; | |
66 | + struct rpmtd_s td; | |
67 | + | |
68 | + if (headerGet(h, tag, &td, HEADERGET_MINMEM)) { | |
69 | + if (rpmtdCount(&td) == 1) { | |
70 | + res = rpmtdGetString(&td); | |
71 | + } | |
72 | + rpmtdFreeData(&td); | |
73 | + } | |
74 | + return res; | |
75 | +} | |
76 | + | |
77 | +static inline uint64_t rpmtdGetNumber(rpmtd td) | |
78 | +{ | |
79 | + uint64_t val = 0; | |
80 | + int ix; | |
81 | + assert(td != NULL); | |
82 | + ix = (td->ix >= 0 ? td->ix : 0); | |
83 | + | |
84 | + switch (td->type) { | |
85 | + case RPM_INT64_TYPE: | |
86 | + val = *((uint64_t *) td->data + ix); | |
87 | + break; | |
88 | + case RPM_INT32_TYPE: | |
89 | + val = *((uint32_t *) td->data + ix); | |
90 | + break; | |
91 | + case RPM_INT16_TYPE: | |
92 | + val = *((uint16_t *) td->data + ix); | |
93 | + break; | |
94 | + case RPM_INT8_TYPE: | |
95 | + case RPM_CHAR_TYPE: | |
96 | + val = *((uint8_t *) td->data + ix); | |
97 | + break; | |
98 | + default: | |
99 | + break; | |
100 | + } | |
101 | + return val; | |
102 | +} | |
103 | + | |
104 | +static inline uint64_t headerGetNumber(Header h, int32_t tag) | |
105 | +{ | |
106 | + uint64_t res = 0; | |
107 | + struct rpmtd_s td; | |
108 | + | |
109 | + if (headerGet(h, tag, &td, HEADERGET_EXT)) { | |
110 | + if (rpmtdCount(&td) == 1) { | |
111 | + res = rpmtdGetNumber(&td); | |
112 | + } | |
113 | + rpmtdFreeData(&td); | |
114 | + } | |
115 | + return res; | |
116 | +} | |
117 | + | |
118 | static inline int | |
119 | cr_compare_dependency(const char *dep1, const char *dep2) | |
120 | { | |
121 | --- createrepo_c/src/parsepkg.c.orig 2013-12-01 15:00:42.000000000 +0100 | |
122 | +++ createrepo_c/src/parsepkg.c 2013-12-01 16:52:24.660513293 +0100 | |
123 | @@ -26,14 +26,17 @@ | |
124 | #include <unistd.h> | |
125 | #include <rpm/rpmts.h> | |
126 | #include <rpm/rpmfi.h> | |
127 | -#include <rpm/rpmlib.h> | |
128 | #include <rpm/rpmmacro.h> | |
129 | -#include <rpm/rpmkeyring.h> | |
130 | +#include <rpm/rpmrc.h> | |
131 | +#include <rpm/pkgio.h> | |
132 | #include "error.h" | |
133 | #include "parsehdr.h" | |
134 | #include "misc.h" | |
135 | #include "checksum.h" | |
136 | ||
137 | +#define _RPMVSF_NOSIGNATURES (RPMVSF_NODSAHEADER | RPMVSF_NORSAHEADER | RPMVSF_NODSA | RPMVSF_NORSA) | |
138 | +#define _RPMVSF_NODIGESTS (RPMVSF_NOSHA1HEADER | RPMVSF_NOMD5HEADER | RPMVSF_NOSHA1 | RPMVSF_NOMD5) | |
139 | + | |
140 | volatile short cr_initialized = 0; | |
141 | rpmts cr_ts = NULL; | |
142 | ||
143 | --- createrepo_c/src/CMakeLists.txt.orig 2013-12-01 15:00:42.000000000 +0100 | |
144 | +++ createrepo_c/src/CMakeLists.txt 2013-12-01 16:53:42.373843363 +0100 | |
145 | @@ -55,6 +55,7 @@ | |
146 | TARGET_LINK_LIBRARIES(libcreaterepo_c ${LZMA_LIBRARIES}) | |
147 | TARGET_LINK_LIBRARIES(libcreaterepo_c ${OPENSSL_LIBRARIES}) | |
148 | TARGET_LINK_LIBRARIES(libcreaterepo_c ${RPMDB_LIBRARY}) | |
149 | +TARGET_LINK_LIBRARIES(libcreaterepo_c rpm) | |
150 | TARGET_LINK_LIBRARIES(libcreaterepo_c ${SQLITE3_LIBRARIES}) | |
151 | TARGET_LINK_LIBRARIES(libcreaterepo_c ${ZLIB_LIBRARY}) | |
152 |