]> sourceware.org Git - systemtap.git/commitdiff
Fixed 1382422 by making stap refer to 'dnf' or 'yum'.
authorDavid Smith <dsmith@redhat.com>
Thu, 6 Oct 2016 16:29:26 +0000 (11:29 -0500)
committerDavid Smith <dsmith@redhat.com>
Thu, 6 Oct 2016 16:29:26 +0000 (11:29 -0500)
* rpm_finder.cxx (missing_rpm_list_print): Ask the user to use the correct
  package manager for his system, either 'dnf' or 'yum'.

rpm_finder.cxx

index 7ad9738c7edd1b54cc7bc258d688ae4ad3aeaeef..b2ff6e3fff35e245d702164a931afacd62583f29 100644 (file)
@@ -208,8 +208,16 @@ missing_rpm_list_print (systemtap_session &sess, const char* rpm_type)
   if (sess.rpms_to_install.size() > 0 && ! sess.suppress_warnings) {
 
     if(strcmp(rpm_type,"-devel")==0)
-       cerr << _("Incorrect version or missing kernel-devel package, use: yum install ");
-
+    {
+       // We default to using 'yum' as the package manager, unless we
+       // can find 'dnf'.
+       string pkg_mgr = "yum";
+       string dnf_path = find_executable("dnf");
+
+       if (is_fully_resolved(dnf_path, "", sess.sysenv))
+           pkg_mgr = "dnf";
+       cerr << _F("Incorrect version or missing kernel-devel package, use: %s install ", pkg_mgr.c_str());
+    }
     else if(strcmp(rpm_type,"-debuginfo")==0)
        cerr << _("Missing separate debuginfos, use: debuginfo-install ");
 
This page took 0.029725 seconds and 5 git commands to generate.