Blame SOURCES/rhbz1056687.patch

f43afa
commit fb3db0ca1cf6bed4bb4beabbf9bf91d09759cae6
f43afa
Author: Martin Cermak <mcermak@redhat.com>
f43afa
Date:   Wed Jan 22 17:01:36 2014 +0100
f43afa
f43afa
    PR16448: adapt stap-prep for el7
f43afa
    
f43afa
    * stap-prep: use yum to install needed kernel information RPMs
f43afa
      should work across all yum-based rhel releases
f43afa
f43afa
diff --git a/stap-prep b/stap-prep
f43afa
index 541316a..dc997ab 100755
f43afa
--- a/stap-prep
f43afa
+++ b/stap-prep
f43afa
@@ -30,18 +30,10 @@ NEEDED=`rpm --qf "%{name}-%{version}-%{release}.%{arch}\n" \
f43afa
     -q $CANDIDATES | grep "is not installed" | awk '{print $2}'`
f43afa
 if [ "$NEEDED" != "" ]; then
f43afa
     echo -e "Need to install the following packages:\n$NEEDED"
f43afa
-    if [ `id -u` = "0" ]; then #attempt download and install
f43afa
-        DIR=`mktemp -d` || exit 1
f43afa
-        if [ ! -x /usr/bin/yumdownloader ]; then
f43afa
-            echo "Need to first install yum-utils for yumdownloader"
f43afa
-            yum install -y yum-utils
f43afa
-        fi
f43afa
-        yumdownloader --enablerepo="*debuginfo*" $NEEDED --destdir=$DIR \
f43afa
-                      --resolve
f43afa
-        check_error $? "problem downloading rpm(s) $NEEDED"
f43afa
-        rpm --force -ivh $DIR/*.rpm
f43afa
+    if [ `id -u` = "0" ]; then #attempt to install
f43afa
+        yum install -y --enablerepo=\* $NEEDED
f43afa
+        rpm -q $NEEDED
f43afa
         check_error $? "problem installing rpm(s) $NEEDED"
f43afa
-        rm -r $DIR #cleanup
f43afa
     fi
f43afa
 fi
f43afa
 }