--- satyr-0.3/lib/Makefile.am.orig 2013-03-18 14:41:43.000000000 +0100 +++ satyr-0.3/lib/Makefile.am 2013-04-05 19:01:16.367253347 +0200 @@ -74,7 +74,7 @@ unstrip.c \ utils.c -libsatyr_la_CFLAGS = -Wall -std=gnu99 -D_GNU_SOURCE $(GLIB_CFLAGS) +libsatyr_la_CFLAGS = -Wall -std=gnu99 -D_GNU_SOURCE $(GLIB_CFLAGS) $(RPM_CFLAGS) libsatyr_la_LDFLAGS = -version-info 1:0:0 $(GLIB_LIBS) if HAVE_LIBOPCODES --- satyr-0.3/configure.ac.orig 2013-04-05 19:30:55.747216259 +0200 +++ satyr-0.3/configure.ac 2013-04-05 19:35:07.100544357 +0200 @@ -63,6 +63,7 @@ AC_CHECK_LIB([unwind-coredump], [main]) # rpm +PKG_CHECK_MODULES([RPM], [rpm]) AC_CHECK_LIB([rpm], [main]) AC_CONFIG_FILES([ --- satyr-0.3/lib/rpm.c.orig 2013-03-25 15:07:04.000000000 +0100 +++ satyr-0.3/lib/rpm.c 2013-04-06 10:59:35.792721546 +0200 @@ -27,7 +27,6 @@ #include #include #include -#include #include #endif #include @@ -249,18 +248,20 @@ rpmTag tag, char **result) { - rpmtd tag_data = rpmtdNew(); - int success = headerGet(header, - tag, - tag_data, - HEADERGET_DEFAULT); + + int_32 type, cnt; + void *p; + const char **strp; + int success = headerGetEntry(header, tag, &type, &p, &cnt); if (success != 1) return false; - const char *str = rpmtdGetString(tag_data); + const char *str = (type == RPM_STRING_TYPE) ? p : + (((type == RPM_STRING_ARRAY_TYPE) || (type == RPM_I18NSTRING_TYPE)) ? *(strp = p) : NULL); *result = (str ? sr_strdup(str) : NULL); - rpmtdFree(tag_data); + if(type == RPM_STRING_ARRAY_TYPE) + free(p); return str; } @@ -269,20 +270,19 @@ rpmTag tag, uint32_t *result) { - rpmtd tag_data = rpmtdNew(); - int success = headerGet(header, - tag, - tag_data, - HEADERGET_DEFAULT); + int_32 type, cnt; + void *p; + int success = headerGetEntry(header, tag, &type, &p, &cnt); if (success != 1) return false; - uint32_t *num = rpmtdGetUint32(tag_data); + if (type != RPM_UINT32_TYPE) + return false; + uint32_t *num = p; if (num) *result = *num; - rpmtdFree(tag_data); return num; }