Fedora: Handle new kernel variant paths
[openafs.git] / src / packaging / RedHat / openafs-kmodtool
index d776cfd..b9ae666 100644 (file)
@@ -40,8 +40,12 @@ get_verrel ()
   verrel=${1:-$(uname -r)}
   verrel=${verrel%%$knownvariants}
   case "$verrel" in
-    *.fc9*)  verrel="`echo ${verrel} | sed -e 's/^\(.*.fc9[^\.]*\)\.[^\.]\+.\?$/\1/'`" ;;
-    *.fc1?*) verrel="`echo ${verrel} | sed -e 's/^\(.*.fc1[0-9][^\.]*\)\.[^\.]\+.\?$/\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/'`" ;;
   esac
 }
 
@@ -71,13 +75,20 @@ get_rpmtemplate ()
     local variant="${1}"
     local dashvariant="${variant:+-${variant}}"
     case "$verrel" in
+        *.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
-        *.fc9*) kname="${verrel}.%{_target_cpu}${variant:+.${variant}}" ;;
-        *.fc1?*)  kname="${verrel}.%{_target_cpu}${variant:+.${variant}}" ;;
-        *)      kname="${verrel}${variant}"                             ;;
+        *.el[6-9]*)
+                 kname="${verrel}.%{_target_cpu}${variant:+.${variant}}" ;;
+        *.fc[2-9][0-9]*)
+                 kname="${verrel}.%{_target_cpu}${variant:++${variant}}" ;;
+        *.fc1[0-9]*)
+                 kname="${verrel}.%{_target_cpu}${variant:+.${variant}}" ;;
+        *.fc9*)   kname="${verrel}.%{_target_cpu}${variant:+.${variant}}" ;;
+        *)        kname="${verrel}${variant}"                             ;;
     esac
 
     cat <<EOF