]> TLD Linux GIT Repositories - packages/systemtap.git/blob - systemtap-rpm-4.5-support.patch
- rediffed patches
[packages/systemtap.git] / systemtap-rpm-4.5-support.patch
1 diff -urpa systemtap-3.2.orig/configure.ac systemtap-3.2/configure.ac
2 --- systemtap-3.2.orig/configure.ac     2017-10-18 17:59:37.000000000 +0000
3 +++ systemtap-3.2/configure.ac  2018-03-14 12:27:03.557939628 +0000
4 @@ -465,6 +465,19 @@ AC_ARG_WITH([rpm],
5    [AS_HELP_STRING([--with-rpm],
6                    [query rpm database for missing debuginfos])], [], [with_rpm="auto"])
7  if test "$with_rpm" != "no"; then
8 +  PKG_CHECK_MODULES([RPM], [rpm], [
9 +      AC_DEFINE_UNQUOTED([HAVE_RPM],1,[Define if RPM backend is available])
10 +      CPPFLAGS="$RPM_CFLAGS $CPPFLAGS"
11 +      stap_LIBS="$stap_LIBS $RPM_LIBS"
12 +   ], [
13 +      AC_PATH_PROG(RPM_PATH,rpm,none)
14 +      if test "$RPM_PATH" = "none"; then
15 +         AC_MSG_ERROR([RPM executable was not found in your system])
16 +      else
17 +         AC_DEFINE_UNQUOTED([HAVE_RPM],1,[Define if RPM backend is available])
18 +      fi
19 +   ]
20 +)
21    AC_CHECK_LIB(rpm, rpmtsInitIterator, [
22                      AC_DEFINE([HAVE_LIBRPM],[1],[have librpm])
23                      stap_LIBS="$stap_LIBS -lc -lrpm"
24 diff -urpa systemtap-3.2.orig/rpm_finder.cxx systemtap-3.2/rpm_finder.cxx
25 --- systemtap-3.2.orig/rpm_finder.cxx   2017-10-18 17:59:37.000000000 +0000
26 +++ systemtap-3.2/rpm_finder.cxx        2018-03-14 12:24:39.000000000 +0000
27 @@ -24,6 +24,7 @@ extern "C" {
28  
29  #include <string.h>
30  #include <rpm/rpmlib.h>
31 +#include <rpm/rpmmacro.h>
32  #include <rpm/rpmts.h>
33  #include <rpm/rpmdb.h>
34  #include <rpm/header.h>
35 @@ -99,7 +100,9 @@ missing_rpm_enlist (systemtap_session& s
36             break;
37           /* Verify the kernel file is not already installed.  */
38  
39 -         rpminfo = headerFormat(h, header, &err);
40 +         char *nvra = rpmExpand("%{___NVRA}", NULL);
41 +         rpminfo = headerSprintf(h, header, rpmTagTable, rpmHeaderFormats, &err);
42 +         free(nvra);
43  
44           if (!rpminfo)
45             {
46 @@ -151,9 +154,10 @@ missing_rpm_enlist (systemtap_session& s
47             }
48           /* The allocated memory gets utilized below for MISSING_RPM_HASH.  */
49            if(strcmp(rpm_type,"-debuginfo")==0){
50 +           char *nvra = rpmExpand("%{___NVRA}", NULL);
51             xfree(rpminfo);
52 -           rpminfo = headerFormat(h, "%{name}-%{version}-%{release}.%{arch}",
53 -                                  &err);
54 +           rpminfo = headerSprintf(h, nvra, rpmTagTable, rpmHeaderFormats, &err);
55 +           free(nvra);
56           }
57           if (!rpminfo)
58             {