1 --- systemtap-1.5/configure.ac.rpm5~ 2011-05-23 21:21:36.000000000 +0200
2 +++ systemtap-1.5/configure.ac 2011-09-26 08:22:28.072465175 +0200
3 @@ -449,6 +449,19 @@ AC_ARG_WITH([rpm],
4 [AS_HELP_STRING([--with-rpm],
5 [query rpm database for missing debuginfos])], [], [with_rpm="auto"])
6 if test "$with_rpm" != "no"; then
7 + PKG_CHECK_MODULES([RPM], [rpm], [
8 + AC_DEFINE_UNQUOTED([HAVE_RPM],1,[Define if RPM backend is available])
9 + CPPFLAGS="$RPM_CFLAGS $CPPFLAGS"
10 + stap_LIBS="$stap_LIBS $RPM_LIBS"
12 + AC_PATH_PROG(RPM_PATH,rpm,none)
13 + if test "$RPM_PATH" = "none"; then
14 + AC_MSG_ERROR([RPM executable was not found in your system])
16 + AC_DEFINE_UNQUOTED([HAVE_RPM],1,[Define if RPM backend is available])
20 AC_CHECK_LIB(rpm, rpmtsInitIterator, [
21 AC_DEFINE([HAVE_LIBRPM],[1],[have librpm])
22 stap_LIBS="$stap_LIBS -lrpm"
23 --- systemtap-1.5/rpm_finder.cxx.rpm5~ 2011-05-23 21:21:36.000000000 +0200
24 +++ systemtap-1.5/rpm_finder.cxx 2011-09-26 08:14:28.829226303 +0200
25 @@ -20,21 +20,22 @@ using namespace std;
31 -#define _RPM_4_4_COMPAT
33 -#include <rpm/rpmlib.h>
34 -#include <rpm/rpmts.h>
35 -#include <rpm/rpmdb.h>
36 -#include <rpm/header.h>
38 +#include <tr1/cstdint>
39 +#include <rpmtypes.h>
40 +#include <rpmiotypes.h>
45 +#include <rpmmacro.h>
55 #if ! HAVE_LIBRPMIO && HAVE_NSS
58 @@ -51,7 +52,7 @@ missing_rpm_enlist (systemtap_session& s
60 static int rpm_init_done = 0;
62 - rpmdbMatchIterator mi;
67 @@ -90,8 +91,8 @@ missing_rpm_enlist (systemtap_session& s
69 size_t rpminfolen = strlen(rpm_type);
70 size_t srcrpmlen = sizeof (".src.rpm") - 1;
71 - rpmdbMatchIterator mi_rpminfo;
72 - h = rpmdbNextIterator(mi);
77 /* Verify the kernel file is not already installed. */
78 @@ -138,21 +139,23 @@ missing_rpm_enlist (systemtap_session& s
79 /* s = `-debuginfo-%{version}-%{release}.%{arch}' */
81 /* RPMDBI_PACKAGES requires keylen == sizeof (int). */
82 - /* RPMDBI_LABEL is an interface for NVR-based dbiFindByLabel(). */
83 - mi_rpminfo = rpmtsInitIterator(ts, (rpmTag) RPMDBI_LABEL,
84 + /* RPMTAG_NVRA is an interface for NVR-based dbiFindByLabel(). */
85 + mi_rpminfo = rpmtsInitIterator(ts, (rpmTag) RPMTAG_NVRA,
89 - rpmdbFreeIterator(mi_rpminfo);
90 + rpmmiFree(mi_rpminfo);
94 /* The allocated memory gets utilized below for MISSING_RPM_HASH. */
95 if(strcmp(rpm_type,"-debuginfo")==0){
96 + char *nvra = rpmExpand("%{___NVRA}", NULL);
98 rpminfo = headerSprintf(h,
99 - "%{name}-%{version}-%{release}.%{arch}",
101 rpmTagTable, rpmHeaderFormats, &err);
106 @@ -176,7 +179,7 @@ missing_rpm_enlist (systemtap_session& s
107 sess.rpms_to_install.insert(rpminfo);
110 - rpmdbFreeIterator(mi);