From cddc732ec5fd40c94126e5f0b7103136592a2efe Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Mon, 23 Dec 2013 13:32:28 -0500 Subject: [PATCH] RedHat: Munge future kernel versions We currently look for "fc1?" (that is, fc10 through fc19) when trying to munge the kernel version in some ways. This broke on Fedora 20, since 20 obviously does not match "fc1?". Similarly, we look specifically for "el6" for RHEL6 versioning quirks, but these will break on RHEL7 and beyond. Change the version checks so that this will work all the way through Fedora 99 and RHEL 9. That won't work forever, but it will keep us working for a few versions if the versioning quirks do not change. Change-Id: I64dfd483eb2cfa57d67c97ae6db09be5bb020195 Reviewed-on: http://gerrit.openafs.org/10618 Tested-by: BuildBot Reviewed-by: Derrick Brashear Reviewed-by: Ken Dreyer --- src/packaging/RedHat/openafs-kmodtool | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/packaging/RedHat/openafs-kmodtool b/src/packaging/RedHat/openafs-kmodtool index b136e25b19..8451b35777 100644 --- a/src/packaging/RedHat/openafs-kmodtool +++ b/src/packaging/RedHat/openafs-kmodtool @@ -40,10 +40,12 @@ get_verrel () verrel=${1:-$(uname -r)} verrel=${verrel%%$knownvariants} case "$verrel" in - *.el6.elrepo*) verrel="`echo ${verrel} | sed -e 's/^\(.*.el6.elrepo[^\.]*\)\.[^\.]\+.\?$/\1/'`" ;; - *.el6*) verrel="`echo ${verrel} | sed -e 's/^\(.*.el6[^\.]*\)\.[^\.]\+.\?$/\1/'`" ;; + *.el[6-9].elrepo*) + verrel="`echo ${verrel} | sed -e 's/^\(.*.el[6-9].elrepo[^\.]*\)\.[^\.]\+.\?$/\1/'`" ;; + *.el[6-9]*) verrel="`echo ${verrel} | sed -e 's/^\(.*.el[6-9][^\.]*\)\.[^\.]\+.\?$/\1/'`" ;; + *.fc[1-9][0-9]*) + verrel="`echo ${verrel} | sed -e 's/^\(.*.fc[1-9][0-9][^\.]*\)\.[^\.]\+.\?$/\1/'`" ;; *.fc9*) verrel="`echo ${verrel} | sed -e 's/^\(.*.fc9[^\.]*\)\.[^\.]\+.\?$/\1/'`" ;; - *.fc1?*) verrel="`echo ${verrel} | sed -e 's/^\(.*.fc1[0-9][^\.]*\)\.[^\.]\+.\?$/\1/'`" ;; esac } @@ -73,14 +75,17 @@ get_rpmtemplate () local variant="${1}" local dashvariant="${variant:+-${variant}}" case "$verrel" in - *.el6*) kdep="kernel-%{_target_cpu} = ${verrel}${variant}" ;; + *.el[6-9]*) + kdep="kernel-%{_target_cpu} = ${verrel}${variant}" ;; *.EL*) kdep="kernel${dashvariant}-%{_target_cpu} = ${verrel}" ;; *) kdep="kernel-%{_target_cpu} = ${verrel}${variant}" ;; esac case "$verrel" in - *.el6*) kname="${verrel}.%{_target_cpu}${variant:+.${variant}}" ;; + *.el[6-9]*) + kname="${verrel}.%{_target_cpu}${variant:+.${variant}}" ;; + *.fc[1-9][0-9]*) + kname="${verrel}.%{_target_cpu}${variant:+.${variant}}" ;; *.fc9*) kname="${verrel}.%{_target_cpu}${variant:+.${variant}}" ;; - *.fc1?*) kname="${verrel}.%{_target_cpu}${variant:+.${variant}}" ;; *) kname="${verrel}${variant}" ;; esac