Blame SOURCES/rhbz1312169.patch

9201c6
commit 63a758b4890e729195fde868e34d0015cda8b065
9201c6
Author: Frank Ch. Eigler <fche@redhat.com>
9201c6
Date:   Thu Aug 11 13:40:55 2016 -0400
9201c6
9201c6
    RHBZ1312169: make stap-prep fall back to debuginfo-install
9201c6
    
9201c6
    On some fedora / rhel boxes and their repo selections,
9201c6
    "debuginfo-install" can sometimes fetch the right files
9201c6
    even if "yum install" cannot.
9201c6
9201c6
diff --git a/stap-prep b/stap-prep
9201c6
index 5c233bf..ca9adff 100755
9201c6
--- a/stap-prep
9201c6
+++ b/stap-prep
9201c6
@@ -26,13 +26,17 @@ KERN_ARCH=`uname -m`
9201c6
 KERN_REV=`echo $UNAME | sed s/.$KERN_ARCH//` # strip arch from uname
9201c6
 CANDIDATES="$KERNEL-$KERN_REV.$KERN_ARCH \
9201c6
   $KERNEL-devel-$KERN_REV.$KERN_ARCH \
9201c6
+  yum-utils \
9201c6
   $KERNEL-debuginfo-$KERN_REV.$KERN_ARCH"
9201c6
 NEEDED=`rpm --qf "%{name}-%{version}-%{release}.%{arch}\n" \
9201c6
     -q $CANDIDATES | grep "is not installed" | awk '{print $2}'`
9201c6
 if [ "$NEEDED" != "" ]; then
9201c6
     echo -e "Need to install the following packages:\n$NEEDED"
9201c6
     if [ `id -u` = "0" ]; then #attempt to install
9201c6
-        yum install -y --enablerepo=\* $NEEDED
9201c6
+        yum install -y --enablerepo=\* $NEEDED ||
9201c6
+	    (if expr "$NEEDED" : ".*debuginfo.*" >/dev/null;
9201c6
+             then debuginfo-install -y $KERNEL-$KERN_REV.$KERN_ARCH;
9201c6
+             fi)
9201c6
         rpm -q $NEEDED
9201c6
         check_error $? "problem installing rpm(s) $NEEDED"
9201c6
     fi