X-Git-Url: https://git.tld-linux.org/?p=packages%2Fsystemtap.git;a=blobdiff_plain;f=systemtap-rpm-4.5-support.patch;fp=systemtap-rpm-4.5-support.patch;h=5e3c4620058ba67612976116a8e386ef7755076a;hp=0000000000000000000000000000000000000000;hb=78303a129e883b0ab2b32cc58aed781f0a875ab8;hpb=837e6357560e8f7856650e51069835d11953aa08 diff --git a/systemtap-rpm-4.5-support.patch b/systemtap-rpm-4.5-support.patch new file mode 100644 index 0000000..5e3c462 --- /dev/null +++ b/systemtap-rpm-4.5-support.patch @@ -0,0 +1,58 @@ +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) + {