From: Sebastian Pipping Date: Wed, 22 Jun 2011 16:54:09 +0000 (+0200) Subject: Refactoring: Turn to if-elifs constructs into case blocks X-Git-Tag: v3.4.17~5 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b9b1b765cbbcf16a561d0f2289d6717018eaf2b2;p=genkernel.git Refactoring: Turn to if-elifs constructs into case blocks --- diff --git a/gen_compile.sh b/gen_compile.sh index ec752ce..eb13dde 100755 --- a/gen_compile.sh +++ b/gen_compile.sh @@ -231,15 +231,17 @@ compile_generic() { local target=${1} local argstype=${2} - if [ "${argstype}" = 'kernel' ] || [ "${argstype}" = 'runtask' ] - then - export_kernel_args - MAKE=${KERNEL_MAKE} - elif [ "${2}" = 'utils' ] - then - export_utils_args - MAKE=${UTILS_MAKE} - fi + case "${argstype}" in + kernel|runtask) + export_kernel_args + MAKE=${KERNEL_MAKE} + ;; + utils) + export_utils_args + MAKE=${UTILS_MAKE} + ;; + esac + case "${argstype}" in kernel) ARGS="`compile_kernel_args`" ;; utils) ARGS="`compile_utils_args`" ;; @@ -272,13 +274,11 @@ compile_generic() { unset MAKE unset ARGS - if [ "${argstype}" = 'kernel' ] - then - unset_kernel_args - elif [ "${argstype}" = 'utils' ] - then - unset_utils_args - fi + + case "${argstype}" in + kernel) unset_kernel_args ;; + utils) unset_utils_args ;; + esac } compile_modules() {