KERN_REV=`echo $UNAME | sed s/.$KERN_ARCH//` # strip arch from uname
CANDIDATES="$KERNEL-$KERN_REV.$KERN_ARCH \
$KERNEL-devel-$KERN_REV.$KERN_ARCH \
+ yum-utils \
$KERNEL-debuginfo-$KERN_REV.$KERN_ARCH"
NEEDED=`rpm --qf "%{name}-%{version}-%{release}.%{arch}\n" \
-q $CANDIDATES | grep "is not installed" | awk '{print $2}'`
if [ "$NEEDED" != "" ]; then
echo -e "Need to install the following packages:\n$NEEDED"
if [ `id -u` = "0" ]; then #attempt to install
- yum install -y --enablerepo=\* $NEEDED
+ yum install -y --enablerepo=\* $NEEDED ||
+ (if expr "$NEEDED" : ".*debuginfo.*" >/dev/null;
+ then debuginfo-install -y $KERNEL-$KERN_REV.$KERN_ARCH;
+ fi)
rpm -q $NEEDED
check_error $? "problem installing rpm(s) $NEEDED"
fi