From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QZQoa-00044L-M0 for garchives@archives.gentoo.org; Wed, 22 Jun 2011 17:02:08 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C62E01C235; Wed, 22 Jun 2011 17:01:21 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 963191C235 for ; Wed, 22 Jun 2011 17:01:21 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 01AFF1B401A for ; Wed, 22 Jun 2011 17:01:20 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 4CBC88003C for ; Wed, 22 Jun 2011 17:01:20 +0000 (UTC) From: "Sebastian Pipping" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sebastian Pipping" Message-ID: Subject: [gentoo-commits] proj/genkernel:master commit in: / X-VCS-Repository: proj/genkernel X-VCS-Files: gen_compile.sh X-VCS-Directories: / X-VCS-Committer: sping X-VCS-Committer-Name: Sebastian Pipping X-VCS-Revision: b9b1b765cbbcf16a561d0f2289d6717018eaf2b2 Date: Wed, 22 Jun 2011 17:01:20 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: ddf660ca886ae26a065e20621b6aee52 commit: b9b1b765cbbcf16a561d0f2289d6717018eaf2b2 Author: Sebastian Pipping pipping org> AuthorDate: Wed Jun 22 16:54:09 2011 +0000 Commit: Sebastian Pipping gentoo org> CommitDate: Wed Jun 22 16:54:09 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/genkernel.git= ;a=3Dcommit;h=3Db9b1b765 Refactoring: Turn to if-elifs constructs into case blocks --- gen_compile.sh | 32 ++++++++++++++++---------------- 1 files changed, 16 insertions(+), 16 deletions(-) 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=3D${1} local argstype=3D${2} =20 - if [ "${argstype}" =3D 'kernel' ] || [ "${argstype}" =3D 'runtask' ] - then - export_kernel_args - MAKE=3D${KERNEL_MAKE} - elif [ "${2}" =3D 'utils' ] - then - export_utils_args - MAKE=3D${UTILS_MAKE} - fi + case "${argstype}" in + kernel|runtask) + export_kernel_args + MAKE=3D${KERNEL_MAKE} + ;; + utils) + export_utils_args + MAKE=3D${UTILS_MAKE} + ;; + esac + case "${argstype}" in kernel) ARGS=3D"`compile_kernel_args`" ;; utils) ARGS=3D"`compile_utils_args`" ;; @@ -272,13 +274,11 @@ compile_generic() { =20 unset MAKE unset ARGS - if [ "${argstype}" =3D 'kernel' ] - then - unset_kernel_args - elif [ "${argstype}" =3D 'utils' ] - then - unset_utils_args - fi + + case "${argstype}" in + kernel) unset_kernel_args ;; + utils) unset_utils_args ;; + esac } =20 compile_modules() {