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