From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 1B92F138CD8 for ; Fri, 5 Jun 2015 04:54:55 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E5F9CE08C2; Fri, 5 Jun 2015 04:54:47 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 00508E08AB for ; Fri, 5 Jun 2015 04:54:46 +0000 (UTC) Received: from vapier (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with SMTP id DD4C5340DDF for ; Fri, 5 Jun 2015 04:54:45 +0000 (UTC) Date: Fri, 5 Jun 2015 00:54:45 -0400 From: Mike Frysinger To: gentoo development Subject: Re: [gentoo-dev] new eclass: go-live.eclass for handling go live ebuilds Message-ID: <20150605045445.GC26696@vapier> Mail-Followup-To: gentoo development References: <20150604191027.GA18492@linux1.gaikai.biz> 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: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="6e7ZaeXHKrTJCxdu" Content-Disposition: inline In-Reply-To: <20150604191027.GA18492@linux1.gaikai.biz> X-Archives-Salt: 25a670fc-db19-4fb8-a6f3-0792ba9b15c9 X-Archives-Hash: d84bdf0f371358957f4744307a23e393 --6e7ZaeXHKrTJCxdu Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 04 Jun 2015 14:10, William Hubbs wrote: > # @ECLASS: go-live.eclass since we're going to have a common go eclass, and i don't think we'll want = to=20 call it "go.eclass", this too probably should not be go-xxx. if we assume = the=20 base one will be "golang.eclass", then this should be golang-xxx.eclass. i= 'd=20 prefer golang-vcs.eclass myself as that's the naming we've been moving towa= rds. > # @MAINTAINER: > # William Hubbs > # @BLURB: Eclass for fetching and unpacking go repositories. > # @DESCRIPTION: > # This eclass is written to ease the maintenance of live ebuilds > # of software written in the Go programming language. this should note the ebuild is responsible for depending on the right vcs= =20 packages. e.g. if you use git, then you need to depend on git. although ... > # @ECLASS-VARIABLE: EGO_PN > # @REQUIRED > # @DESCRIPTION: > # This is the import path for the go package. Please emerge dev-lang/go > # and read "go help importpath" for syntax. > # > # Example: > # @CODE > # EGO_PN=3D"github.com/user/project" > # @CODE can't we automate some of the common hosts ? if it says github, we know it= 's=20 going to be using at least git. > local saved_umask > if [[ ${EVCS_UMASK} ]]; then > saved_umask=3D$(umask) > umask "${EVCS_UMASK}" || > die "${ECLASS}: bad options to umask: ${EVCS_UMASK}" > fi use `eumask_push` instead on a related note, i don't think we should encourage the implicit -n operat= or. =20 it adds no overhead and really no code maintenance to specify it. converse= ly, i'm not sure it can be considered common usage. and even if it is, i still= =20 don't see a good reason to not just use the explicit -n as it's clear to th= e=20 reader what it's doing. > if [[ ! -d ${EGO_STORE_DIR} ]]; then > ( > addwrite / > mkdir -p "${EGO_STORE_DIR}" || die > ) || die "${ECLASS}: unable to create ${EGO_STORE_DIR}" > fi the inner die is redundant > if [[ ${saved_umask} ]]; then > umask "${saved_umask}" || > die "${ECLASS}: unable to restore saved umask" > fi use `eumask_pop` instead > [[ ${EGO_PN} ]] || > die "${ECLASS}: EGO_PN is not set" prefer -z && myself [[ -z ${EGO_PN} ]] && die ... > if [[ ${EVCS_OFFLINE} ]]; then > export GOPATH=3D"${S}:${GOPATH}" what if GOPATH isn't set ? should this always be appending a colon ? > local saved_umask > if [[ ${EVCS_UMASK} ]]; then > saved_umask=3D$(umask) > umask "${EVCS_UMASK}" || > die "${ECLASS}: Bad options to umask: ${EVCS_UMASK}" > fi use `eumask_push` instead > go get -d -t -u -v -x "$EGO_PN" needs braces around ${EGO_PN}, and shouldn't this be calling `die` ? would also be useful to show the command you're running: set -- go get -d -t -u -v -x "${EGO_PN}" echo "$@" "$@" || die > if [[ ${saved_umask} ]]; then > umask "${saved_umask}" || > die "${ECLASS}: unable to restore saved umask" > fi use `eumask_pop` instead > export GOPATH=3D"${S}:${GOPATH}" same questions here -mike --6e7ZaeXHKrTJCxdu Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJVcSuVAAoJEEFjO5/oN/WBDpUP/1TROkNfk2n+zk60whn3pRT/ qmcBIISXnN0nTdffKZRdlzZ6v27gcsr6zFJJPWtI/Xy3LhcdERq5QKgGHqoffQ4p AyjMRwslcU1iFr5P/QtjL843nXNWLUZUpbbuA5oO8xMeJmn2f4fcuQCHPH8rgLBe QTdvSnsiHUnHCBV1DA8IiizeRvk/F4BtOCPgKgatfC5KngAhjTLvTrbh3xZM79gQ Hwlm399SE1HoKBb2RICQS/wwgq3BNbrOh5wpBV12PxDx72BoD1O8nF05GIKUhQTa 2IRP38T2WHgPW8cCEVz7IlyNR/KQepswak8TwOehhdSjfznV4E0soIwvIoUhILME xOlJrX+qkIhLbchdunmfm735J2pEJwIdGliu672srOxApyTw2Zkl131wcMnekzKj q1QuvLvAAKGvj0CplJBK5UomFETROgGtfsxpwffKeGiXu7jrVrUzAqAf+FWUPiIW reV4vcMme8z0OBy+HMjCFRB+OOAiIAHWKRS1VbD+xoDwo1H2AK1h2dcyj2VBrrKK A6EVz5MY/acoQxQ2uli3KWPilEi+o/J7CNn/nEHqqySmixshBzqFDcdbPnxd4aTi Em2KxM4vQrbu6vMUrD6CcVCrvxmfiMohHU0hyj1AGWT9te+XasLnlu+Lvig8cZxB j3memjkkYopsKVvE9IPi =0XoY -----END PGP SIGNATURE----- --6e7ZaeXHKrTJCxdu--