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 A68131381F3 for ; Mon, 17 Jun 2013 07:23:38 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id EEA0DE08ED; Mon, 17 Jun 2013 07:23:30 +0000 (UTC) Received: from earth.treva.nl (earth.treva.nl [188.95.90.123]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 4F6E5E08C0 for ; Mon, 17 Jun 2013 07:23:30 +0000 (UTC) Received: from 97-13-ftth.onsnetstudenten.nl ([145.120.13.97]) by earth.treva.nl with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1UoTmh-00076K-BG for gentoo-portage-dev@lists.gentoo.org; Mon, 17 Jun 2013 09:23:28 +0200 From: Ruud Koolen To: gentoo-portage-dev@lists.gentoo.org Subject: [gentoo-portage-dev] [PATCH 1/3] Distinguish between portage prefix and package prefix Date: Mon, 17 Jun 2013 09:23:23 +0200 User-Agent: KMail/1.9.10 (enterprise35 0.20100827.1168748) References: <201306170921.41945.redlizard@redlizard.nl> In-Reply-To: <201306170921.41945.redlizard@redlizard.nl> X-KMail-QuotePrefix: > 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: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <201306170923.23472.redlizard@redlizard.nl> X-Archives-Salt: e7bae208-5f6b-48c8-91d2-964e5f621e0c X-Archives-Hash: 1e1d27d895ad314afa736af9d09efa4e This lets portage distinguish between the prefix where portage itself is installed, and the prefix of the packages it is installing. The former is stored in portage.const.EPREFIX and should rarely be overridden (though the PORTAGE_OVERRIDE_EPREFIX environment variable remains), whereas the latter can be found in the EPREFIX variable of a config instance and is much more readily changed. --- bin/dispatch-conf | 2 +- bin/portageq | 2 +- pym/portage/dispatch_conf.py | 2 +- pym/portage/package/ebuild/doebuild.py | 2 +- pym/portage/util/env_update.py | 3 +-- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/bin/dispatch-conf b/bin/dispatch-conf index a41464f..10455f4 100755 --- a/bin/dispatch-conf +++ b/bin/dispatch-conf @@ -79,7 +79,7 @@ class dispatch: confs = [] count = 0 - config_root = portage.const.EPREFIX or os.sep + config_root = portage.settings["EPREFIX"] or os.sep self.options = portage.dispatch_conf.read_config(MANDATORY_OPTS) if "log-file" in self.options: diff --git a/bin/portageq b/bin/portageq index c88ee88..1ae1fe1 100755 --- a/bin/portageq +++ b/bin/portageq @@ -1232,7 +1232,7 @@ def main(argv): sys.stderr.write("Run portageq with --help for info\n") sys.stderr.flush() sys.exit(os.EX_USAGE) - eprefix = portage.const.EPREFIX + eprefix = portage.settings["EPREFIX"] eroot = portage.util.normalize_path(argv[2]) if eprefix: diff --git a/pym/portage/dispatch_conf.py b/pym/portage/dispatch_conf.py index 4c68dfc..570bd8c 100644 --- a/pym/portage/dispatch_conf.py +++ b/pym/portage/dispatch_conf.py @@ -43,7 +43,7 @@ def diffstatusoutput(cmd, file1, file2): return (proc.wait(), output) def read_config(mandatory_opts): - eprefix = portage.const.EPREFIX + eprefix = portage.settings["EPREFIX"] config_path = os.path.join(eprefix or os.sep, "etc/dispatch-conf.conf") loader = KeyValuePairFileLoader(config_path, None) opts, errors = loader.load() diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py index 6de47bb..69463d2 100644 --- a/pym/portage/package/ebuild/doebuild.py +++ b/pym/portage/package/ebuild/doebuild.py @@ -159,7 +159,7 @@ def _doebuild_path(settings, eapi=None): # Note: PORTAGE_BIN_PATH may differ from the global constant # when portage is reinstalling itself. portage_bin_path = settings["PORTAGE_BIN_PATH"] - eprefix = settings["EPREFIX"] + eprefix = portage.const.EPREFIX prerootpath = [x for x in settings.get("PREROOTPATH", "").split(":") if x] rootpath = [x for x in settings.get("ROOTPATH", "").split(":") if x] overrides = [x for x in settings.get( diff --git a/pym/portage/util/env_update.py b/pym/portage/util/env_update.py index e9c06c5..289842c 100644 --- a/pym/portage/util/env_update.py +++ b/pym/portage/util/env_update.py @@ -46,12 +46,11 @@ def env_update(makelinks=1, target_root=None, prev_mtimes=None, contents=None, if isinstance(env, config): vardbapi = vartree(settings=env).dbapi else: + eprefix = portage.settings["EPREFIX"] if target_root is None: - eprefix = portage.settings["EPREFIX"] target_root = portage.settings["ROOT"] target_eroot = portage.settings['EROOT'] else: - eprefix = portage.const.EPREFIX target_eroot = os.path.join(target_root, eprefix.lstrip(os.sep)) target_eroot = target_eroot.rstrip(os.sep) + os.sep -- 1.7.2.5