diff -urpa systemtap-3.2.orig/configure.ac systemtap-3.2/configure.ac --- systemtap-3.2.orig/configure.ac 2017-10-18 17:59:37.000000000 +0000 +++ systemtap-3.2/configure.ac 2018-03-14 12:27:03.557939628 +0000 @@ -465,6 +465,19 @@ AC_ARG_WITH([rpm], [AS_HELP_STRING([--with-rpm], [query rpm database for missing debuginfos])], [], [with_rpm="auto"]) if test "$with_rpm" != "no"; then + PKG_CHECK_MODULES([RPM], [rpm], [ + AC_DEFINE_UNQUOTED([HAVE_RPM],1,[Define if RPM backend is available]) + CPPFLAGS="$RPM_CFLAGS $CPPFLAGS" + stap_LIBS="$stap_LIBS $RPM_LIBS" + ], [ + AC_PATH_PROG(RPM_PATH,rpm,none) + if test "$RPM_PATH" = "none"; then + AC_MSG_ERROR([RPM executable was not found in your system]) + else + AC_DEFINE_UNQUOTED([HAVE_RPM],1,[Define if RPM backend is available]) + fi + ] +) AC_CHECK_LIB(rpm, rpmtsInitIterator, [ AC_DEFINE([HAVE_LIBRPM],[1],[have librpm]) stap_LIBS="$stap_LIBS -lc -lrpm" diff -urpa systemtap-3.2.orig/rpm_finder.cxx systemtap-3.2/rpm_finder.cxx --- systemtap-3.2.orig/rpm_finder.cxx 2017-10-18 17:59:37.000000000 +0000 +++ systemtap-3.2/rpm_finder.cxx 2018-03-14 12:24:39.000000000 +0000 @@ -24,6 +24,7 @@ extern "C" { #include #include +#include #include #include #include @@ -99,7 +100,9 @@ missing_rpm_enlist (systemtap_session& s break; /* Verify the kernel file is not already installed. */ - rpminfo = headerFormat(h, header, &err); + char *nvra = rpmExpand("%{___NVRA}", NULL); + rpminfo = headerSprintf(h, header, rpmTagTable, rpmHeaderFormats, &err); + free(nvra); if (!rpminfo) { @@ -151,9 +154,10 @@ missing_rpm_enlist (systemtap_session& s } /* The allocated memory gets utilized below for MISSING_RPM_HASH. */ if(strcmp(rpm_type,"-debuginfo")==0){ + char *nvra = rpmExpand("%{___NVRA}", NULL); xfree(rpminfo); - rpminfo = headerFormat(h, "%{name}-%{version}-%{release}.%{arch}", - &err); + rpminfo = headerSprintf(h, nvra, rpmTagTable, rpmHeaderFormats, &err); + free(nvra); } if (!rpminfo) {