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 1QBxTf-0006Xt-Oz for garchives@archives.gentoo.org; Mon, 18 Apr 2011 23:03:32 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 924151C021; Mon, 18 Apr 2011 23:03:21 +0000 (UTC) Received: from a1iwww1.kph.uni-mainz.de (a1iwww1.kph.uni-mainz.de [134.93.134.1]) by pigeon.gentoo.org (Postfix) with ESMTP id 9BAB11C008 for ; Mon, 18 Apr 2011 23:02:49 +0000 (UTC) Received: from a1i15.kph.uni-mainz.de (a1i15.kph.uni-mainz.de [134.93.134.92]) by a1iwww1.kph.uni-mainz.de (8.14.4/8.13.4) with ESMTP id p3IN2mI5016579 for ; Tue, 19 Apr 2011 01:02:48 +0200 Received: from a1i15.kph.uni-mainz.de (localhost [127.0.0.1]) by a1i15.kph.uni-mainz.de (8.14.4/8.14.2) with ESMTP id p3IN2mRO022604; Tue, 19 Apr 2011 01:02:48 +0200 Received: (from ulm@localhost) by a1i15.kph.uni-mainz.de (8.14.4/8.14.4/Submit) id p3IN2lIG022603; Tue, 19 Apr 2011 01:02:47 +0200 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19884.49943.966176.931006@a1i15.kph.uni-mainz.de> Date: Tue, 19 Apr 2011 01:02:47 +0200 To: gentoo-dev@lists.gentoo.org Subject: Re: [gentoo-dev] New mysql eclasses review In-Reply-To: <4DACAC72.5070406@gentoo.org> References: <4DACAC72.5070406@gentoo.org> X-Mailer: VM 8.1.1 under 23.3.1 (x86_64-pc-linux-gnu) From: Ulrich Mueller X-Archives-Salt: X-Archives-Hash: eca1c10bc0c76661f55773267bba158f >>>>> On Mon, 18 Apr 2011, Jorge Manuel B S Vicetto wrote: > The mysql team now uses 3 eclasses: mysql-v2.eclass[2] (base > eclass), mysql-autotools.eclass[3] (for autotools based releases) > and mysql-cmake.eclass[4] (for cmake based releases). The first 2 > eclasses are complete, pending any updates from the review. The > mysql-cmake eclass is still under development, but can also benefit > from a review. I didn't go through all of it, but here are a few things that I've noticed in mysql-v2.eclass: > # @ECLASS: mysql.eclass Shouldn't this match the filename of the eclass? (Same for mysql-autotools.eclass.) > # @DESCRIPTION: > # The mysql.eclass provides almost all the code to build the mysql ebuilds > # including the src_unpack, src_prepare, src_configure, src_compile, > # scr_install, pkg_preinst, pkg_postinst, pkg_config and pkg_postrm > # phase hooks. Name of the eclass should be updated. > MYSQL_EXPF="src_unpack src_compile src_install" > case "${EAPI:-0}" in > 2|3|4) MYSQL_EXPF+=" src_prepare src_configure" ;; > *) die "Unsupported EAPI: ${EAPI}" ;; > esac > EXPORT_FUNCTIONS ${MYSQL_EXPF} You don't need a global variable here: ,---- | EXPORT_FUNCTIONS src_unpack src_compile src_install | case "${EAPI:-0}" in | 2|3|4) EXPORT_FUNCTIONS src_prepare src_configure ;; | *) die "Unsupported EAPI: ${EAPI}" ;; | esac `---- or even: ,---- | case "${EAPI:-0}" in | 2|3|4) ;; | *) die "Unsupported EAPI: ${EAPI}" ;; | esac | EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install `---- > # @ECLASS-VARIABLE: XTRADB_VER > # @DESCRIPTION: > # Version of the XTRADB storage engine > XTRADB_VER="${XTRADB_VER}" Is this assignment needed, or could you use @DEFAULT_UNSET instead? (Assuming it's for the eclass manpage.) Same for other variables. > # Having different flavours at the same time is not a good idea > for i in "mysql" "mysql-community" "mysql-cluster" "mariadb" ; do > [[ "${i}" == ${PN} ]] || Quotes are not necessary here. > pbxt_patch_available \ > && PBXT_P="pbxt-${PBXT_VERSION}" \ > && PBXT_SRC_URI="http://www.primebase.org/download/${PBXT_P}.tar.gz mirror://sourceforge/pbxt/${PBXT_P}.tar.gz" \ > && SRC_URI="${SRC_URI} pbxt? ( ${PBXT_SRC_URI} )" \ > # PBXT_NEWSTYLE means pbxt is in storage/ and gets enabled as other plugins > # vs. built outside the dir > pbxt_available \ > && IUSE="${IUSE} pbxt" \ > && mysql_version_is_at_least "5.1.40" \ > && PBXT_NEWSTYLE=1 > xtradb_patch_available \ > && XTRADB_P="percona-xtradb-${XTRADB_VER}" \ > && XTRADB_SRC_URI_COMMON="${PERCONA_VER}/source/${XTRADB_P}.tar.gz" \ > && XTRADB_SRC_B1="http://www.percona.com/" \ > && XTRADB_SRC_B2="${XTRADB_SRC_B1}/percona-builds/" \ > && XTRADB_SRC_URI1="${XTRADB_SRC_B2}/Percona-Server/Percona-Server-${XTRADB_SRC_URI_COMMON}" \ > && XTRADB_SRC_URI2="${XTRADB_SRC_B2}/xtradb/${XTRADB_SRC_URI_COMMON}" \ > && XTRADB_SRC_URI3="${XTRADB_SRC_B1}/${PN}/xtradb/${XTRADB_SRC_URI_COMMON}" \ > && SRC_URI="${SRC_URI} xtradb? ( ${XTRADB_SRC_URI1} ${XTRADB_SRC_URI2} ${XTRADB_SRC_URI3} )" \ > && IUSE="${IUSE} xtradb" Probably a matter of taste, but I'd use "if" blocks instead of the multiple && here. > mv --strip-trailing-slashes -T "${old_MY_DATADIR_s}" "${MY_DATADIR_s}" \ Both options --strip-trailing-slashes and -T are GNUisms and may not exist on other userlands (like BSD). Ulrich