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 8EC9E138C9D for ; Mon, 1 Jun 2015 18:01:40 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A437EE0935; Mon, 1 Jun 2015 18:01:39 +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 23B32E08E2 for ; Mon, 1 Jun 2015 18:01:39 +0000 (UTC) Received: by smtp.gentoo.org (Postfix, from userid 2274) id 91864340E84; Mon, 1 Jun 2015 18:01:38 +0000 (UTC) Date: Mon, 1 Jun 2015 14:01:08 -0400 From: Tim Harder To: gentoo-portage-dev@lists.gentoo.org Subject: Re: [gentoo-portage-dev] [PATCH] make PORTAGE_BIN_PATH settings relocatable Message-ID: <20150601180108.GF18797@tarragon.analog.com> Mail-Followup-To: gentoo-portage-dev@lists.gentoo.org References: <1433140493-3288-1-git-send-email-vapier@gentoo.org> <20150601172524.GU4496@vapier> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-portage-dev@lists.gentoo.org Reply-to: gentoo-portage-dev@lists.gentoo.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="y0ulUmNC+osPPQO6" Content-Disposition: inline In-Reply-To: <20150601172524.GU4496@vapier> User-Agent: Mutt/1.5.23 (2014-03-12) X-Archives-Salt: 5cd7b941-8c4e-4507-8ede-6af1ca4f0790 X-Archives-Hash: 0d21c301d1f038f66d9266467386d70f --y0ulUmNC+osPPQO6 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline On 2015-06-01 13:25, Mike Frysinger wrote: > > -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh > > +if [[ -z ${PORTAGE_BIN_PATH} ]] ; then > > + PORTAGE_BIN_PATH=$(dirname "$(dirname "$(readlink -f "$0")")") > > +fi > > +source "${PORTAGE_BIN_PATH}"/isolated-functions.sh > alternative crazy ideas: > (a) just throw an error and exit when PORTAGE_BIN_PATH is not set ... > considering the current portage code points to a path where it is no longer > installed, maybe that's ok ? the recent changes to make portage install copies > for each python version is what broke it i think. > (b) add a tool alongside it that can be `eval`-ed, although you'd still need to > do something like: > if [[ -z ${PORTAGE_BIN_PATH} ]] ; then > eval $("$(dirname "$(readlink -f "$0")")/some-tool") > fi > and i don't think that's an improvement relative to my patch (deal with quoting > bs and such). > (c) convert most things to python and use relative module imports to get at the > bootstrap module. then that one would hold all the logic. > (d) some other alternative ? If you're sticking with bash, there is also pkgcore's approach of using a custom shebang script that handles initialization and related generic things for most of the helpers. Tim --y0ulUmNC+osPPQO6 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAABCgAGBQJVbJ3kAAoJEEqz6FtPBkyj/twH/0IHlap75A+OW4NL8hxL3xoH 9yEggvGIyaZcFkYuzy9SXATfJeaIjSW8MA3XKmqYWqa5koXbT+GutZWiJPibymhd fwt7ivCEUcycWMBUIc6mwrOAUvXhU2YMeL6sYpGoI2NbmzSUJMrOH9IKdgpLVEGD Serg1+x1WcSlZAOH7Vsdd7u6zAGrLOMiex1n1aH9hmlP9kK43FPo1M5GcY9FGJep k9j2QPkMCuqCFdAA972KUi9aM+mMufw0V8zIx3Z9FYCuY+kal8hvxkQGo5kcVmFE +OSTjxLWjw6hJcL7jqzmxEtPvCvb9t6b6XfgAOhF40TRECA1F0LZMlRz/mRRLk8= =JnaX -----END PGP SIGNATURE----- --y0ulUmNC+osPPQO6--