commit:     18c4f5bf51af9dab2779cafd2689121d42388aa3
Author:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 19 22:38:06 2020 +0000
Commit:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Tue Oct 20 03:55:05 2020 +0000
URL:        https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=18c4f5bf

targets: Rewrite hppa pre-kmerge check

Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>

 targets/support/pre-kmerge.sh | 43 +++++++++++++++++--------------------------
 1 file changed, 17 insertions(+), 26 deletions(-)

diff --git a/targets/support/pre-kmerge.sh b/targets/support/pre-kmerge.sh
index dd51ae9a..165dfd51 100755
--- a/targets/support/pre-kmerge.sh
+++ b/targets/support/pre-kmerge.sh
@@ -2,32 +2,23 @@
 
 source /tmp/chroot-functions.sh
 
-case ${clst_hostarch} in
-       hppa)
-               got_32=0
-               got_64=0
-               for i in ${clst_boot_kernel}
-               do
-                       if [ "${i: -2}" == "32" ]
-                       then
-                               if [ $got_32 -eq 1 ]
-                               then
-                                       die "Only one 32 bit kernel can be 
configured"
-                               fi
-                               got_32=1
-                       elif [ "${i: -2}" == "64" ]
-                       then
-                               if [ $got_64 -eq 1 ]
-                               then
-                                       die "Only one 64 bit kernel can be 
configured"
-                               fi
-                               got_64=1
-                       else
-                               die "Kernel names must end by either 32 or 64"
-                       fi
-               done
-       ;;
-esac
+if [[ ${clst_hostarch} == hppa ]]; then
+       for i in ${clst_boot_kernel}; do
+               case ${i} in
+                       *32)
+                               let num32++
+                               ;;
+                       *64)
+                               let num64++
+                               ;;
+                       *)
+                               die "Kernel names must end with either \"32\" 
or \"64\""
+                               ;;
+               esac
+       done
+       [[ $num32 > 1 ]] && die "Only one 32-bit kernel can be configured"
+       [[ $num64 > 1 ]] && die "Only one 64-bit kernel can be configured"
+fi
 
 run_merge --oneshot genkernel
 install -d /tmp/kerncache

Reply via email to