[PATCH 4/6] upd-kernel: Use kernel-uname-r provides to find version string

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Recent kernels have changed the format of the version
string, so just use the kernel-uname-r provides to
get it.

Signed-off-by: Mark McLoughlin <markmc@xxxxxxxxxx>
---
 scripts/upd-kernel |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/scripts/upd-kernel b/scripts/upd-kernel
index 3a5483b..66f8da0 100755
--- a/scripts/upd-kernel
+++ b/scripts/upd-kernel
@@ -23,14 +23,8 @@
 OLDDIR=`readlink -f $1`
 NEWDIR=$2
 KRPM=`readlink -f $3`
-KNAME=$(rpm -qp --qf "%{NAME}" $KRPM)
-if [ "$KNAME" != "kernel" ]; then
-    var=$(echo $KNAME | sed -e 's/kernel-//')
-fi
-
-ARCH=$(rpm -qp --qf "%{ARCH}" $KRPM)
-NEWVER=$(rpm -qp --qf "%{VERSION}-%{RELEASE}" $KRPM)$var
 
+NEWVER=$(rpm -qp --provides $KRPM | awk -F ' = ' '/kernel-uname-r/ { print $2; }')
 
 if [ -z "$OLDDIR" -o -z "$NEWDIR" -o -z "$KRPM" ]; then
   echo "Usage: $0 <olddir> <newdir> <newkernelrpm>"
-- 
1.5.4.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux