]> git.pld-linux.org Git - packages/satyr.git/blob - satyr-rpm5.patch
910ab882a060a337e4de4485ac5da05ffa89e59c
[packages/satyr.git] / satyr-rpm5.patch
1 --- satyr-0.13/lib/Makefile.am.orig     2014-01-07 17:07:58.000000000 +0100
2 +++ satyr-0.13/lib/Makefile.am  2014-02-02 20:51:35.551284308 +0100
3 @@ -62,7 +62,7 @@
4         unstrip.c \
5         utils.c
6  
7 -libsatyr_conv_la_CFLAGS = -Wall -std=gnu99 -D_GNU_SOURCE -I$(top_srcdir)/include $(GLIB_CFLAGS)
8 +libsatyr_conv_la_CFLAGS = -Wall -std=gnu99 -D_GNU_SOURCE -I$(top_srcdir)/include $(GLIB_CFLAGS) $(RPM_CFLAGS)
9  libsatyr_conv_la_LDFLAGS = $(GLIB_LIBS)
10  
11  if HAVE_LIBOPCODES
12 --- satyr-0.3/configure.ac.orig 2013-04-05 19:30:55.747216259 +0200
13 +++ satyr-0.3/configure.ac      2013-04-05 19:35:07.100544357 +0200
14 @@ -63,6 +63,7 @@
15  AC_CHECK_LIB([unwind-coredump], [main])
16  
17  # rpm
18 +PKG_CHECK_MODULES([RPM], [rpm])
19  AC_CHECK_LIB([rpm], [main])
20  
21  AC_CONFIG_FILES([
22 --- satyr-0.3/lib/rpm.c.orig    2013-03-25 15:07:04.000000000 +0100
23 +++ satyr-0.3/lib/rpm.c 2013-04-06 15:46:04.134714198 +0200
24 @@ -24,11 +24,11 @@
25  #include "config.h"
26  #include <errno.h>
27  #ifdef HAVE_LIBRPM
28 -#include <rpm/rpmlib.h>
29 +#include <rpm/rpmtag.h>
30  #include <rpm/rpmdb.h>
31 +#include <rpm/rpmio.h>
32 +#include <rpm/rpmrc.h>
33  #include <rpm/rpmts.h>
34 -#include <rpm/rpmtd.h>
35 -#include <rpm/header.h>
36  #endif
37  #include <fcntl.h>
38  #include <assert.h>
39 @@ -249,18 +249,18 @@
40                    rpmTag tag,
41                    char **result)
42  {
43 -    rpmtd tag_data = rpmtdNew();
44 -    int success = headerGet(header,
45 -                            tag,
46 -                            tag_data,
47 -                            HEADERGET_DEFAULT);
48 +    HE_s h;
49 +    memset(&h, 0, sizeof(h));
50 +    h.tag = tag;
51 +    h.ix = -1;
52 +    int success = headerGet(header, &h, 0);
53  
54      if (success != 1)
55          return false;
56  
57 -    const char *str = rpmtdGetString(tag_data);
58 +    const char *str = (h.t == RPM_STRING_TYPE) ? h.p.str :
59 +           (((h.t == RPM_STRING_ARRAY_TYPE) || (h.t == RPM_I18NSTRING_TYPE)) ? h.p.argv[0] : NULL);
60      *result = (str ? sr_strdup(str) : NULL);
61 -    rpmtdFree(tag_data);
62      return str;
63  }
64  
65 @@ -269,20 +269,21 @@
66                    rpmTag tag,
67                    uint32_t *result)
68  {
69 -    rpmtd tag_data = rpmtdNew();
70 -    int success = headerGet(header,
71 -                            tag,
72 -                            tag_data,
73 -                            HEADERGET_DEFAULT);
74 +    HE_s h;
75 +    memset(&h, 0, sizeof(h));
76 +    h.tag = tag;
77 +    h.ix = -1;
78 +    int success = headerGet(header, &h, 0);
79  
80      if (success != 1)
81          return false;
82  
83 -    uint32_t *num = rpmtdGetUint32(tag_data);
84 +    if (h.t != RPM_UINT32_TYPE)
85 +        return false;
86 +    uint32_t *num = h.p.ui32p;
87      if (num)
88          *result = *num;
89  
90 -    rpmtdFree(tag_data);
91      return num;
92  }
93  
94 @@ -361,14 +362,14 @@
95      }
96  
97      rpmts ts = rpmtsCreate();
98 -    rpmdbMatchIterator iter = rpmtsInitIterator(ts,
99 +    rpmmi iter = rpmtsInitIterator(ts,
100                                                  RPMTAG_NAME,
101                                                  name,
102                                                  strlen(name));
103  
104      struct sr_rpm_package *result = NULL;
105      Header header;
106 -    while ((header = rpmdbNextIterator(iter)))
107 +    while ((header = rpmmiNext(iter)))
108      {
109          struct sr_rpm_package *package = header_to_rpm_info(header,
110                                                              error_message);
111 @@ -382,7 +383,7 @@
112          result = sr_rpm_package_append(result, package);
113      }
114  
115 -    rpmdbFreeIterator(iter);
116 +    rpmmiFree(iter);
117      rpmtsFree(ts);
118      return result;
119  #else
120 @@ -403,14 +404,14 @@
121      }
122  
123      rpmts ts = rpmtsCreate();
124 -    rpmdbMatchIterator iter = rpmtsInitIterator(ts,
125 +    rpmmi iter = rpmtsInitIterator(ts,
126                                                  RPMTAG_BASENAMES,
127                                                  path,
128                                                  strlen(path));
129  
130      struct sr_rpm_package *result = NULL;
131      Header header;
132 -    while ((header = rpmdbNextIterator(iter)))
133 +    while ((header = rpmmiNext(iter)))
134      {
135          struct sr_rpm_package *package = header_to_rpm_info(header,
136                                                              error_message);
137 @@ -424,7 +425,7 @@
138          result = sr_rpm_package_append(result, package);
139      }
140  
141 -    rpmdbFreeIterator(iter);
142 +    rpmmiFree(iter);
143      rpmtsFree(ts);
144      return result;
145  #else
This page took 0.185343 seconds and 2 git commands to generate.