public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/
Date: Wed,  9 May 2012 22:08:23 +0000 (UTC)	[thread overview]
Message-ID: <1336601288.1c26d24dfc869a6f5ef426f7c02e1d25abcda34e.zmedico@gentoo> (raw)

commit:     1c26d24dfc869a6f5ef426f7c02e1d25abcda34e
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed May  9 22:08:08 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May  9 22:08:08 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1c26d24d

doebuild_environment: clean up EAPI related code

---
 pym/portage/package/ebuild/doebuild.py |   60 +++++++++++++++----------------
 1 files changed, 29 insertions(+), 31 deletions(-)

diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py
index 53b7080..ad6857f 100644
--- a/pym/portage/package/ebuild/doebuild.py
+++ b/pym/portage/package/ebuild/doebuild.py
@@ -256,7 +256,6 @@ def doebuild_environment(myebuild, mydo, myroot=None, settings=None,
 		mysettings['PORTDIR'] = repo.eclass_db.porttrees[0]
 		mysettings['PORTDIR_OVERLAY'] = ' '.join(repo.eclass_db.porttrees[1:])
 		mysettings.configdict["pkg"]["PORTAGE_REPO_NAME"] = repo.name
-		mysettings.configdict["pkg"]["REPOSITORY"] = repo.name
 
 	mysettings["PORTDIR"] = os.path.realpath(mysettings["PORTDIR"])
 	mysettings["DISTDIR"] = os.path.realpath(mysettings["DISTDIR"])
@@ -331,19 +330,19 @@ def doebuild_environment(myebuild, mydo, myroot=None, settings=None,
 			os.environ["COLUMNS"] = columns
 		mysettings["COLUMNS"] = columns
 
-	# All EAPI dependent code comes last, so that essential variables
-	# like PORTAGE_BUILDDIR are still initialized even in cases when
+	# EAPI is always known here, even for the "depend" phase, because
+	# EbuildMetadataPhase gets it from _parse_eapi_ebuild_head().
+	eapi = mysettings.configdict['pkg']['EAPI']
+	_doebuild_path(mysettings, eapi=eapi)
+
+	# All EAPI dependent code comes last, so that essential variables like
+	# PATH and PORTAGE_BUILDDIR are still initialized even in cases when
 	# UnsupportedAPIException needs to be raised, which can be useful
 	# when uninstalling a package that has corrupt EAPI metadata.
-	eapi = mysettings.configdict['pkg'].get('EAPI')
+	if not eapi_is_supported(eapi):
+		raise UnsupportedAPIException(mycpv, eapi)
 
 	if mydo != "depend":
-		# Metadata vars such as EAPI and RESTRICT are
-		# set by the above config.setcpv() call.
-		if not eapi_is_supported(eapi):
-			# can't do anything with this.
-			_doebuild_path(mysettings)
-			raise UnsupportedAPIException(mycpv, eapi)
 
 		if hasattr(mydbapi, "getFetchMap") and \
 			("A" not in mysettings.configdict["pkg"] or \
@@ -369,9 +368,6 @@ def doebuild_environment(myebuild, mydo, myroot=None, settings=None,
 			else:
 				mysettings.configdict["pkg"]["AA"] = " ".join(uri_map)
 
-	_doebuild_path(mysettings, eapi=eapi)
-
-	if mydo != "depend":
 		ccache = "ccache" in mysettings.features
 		distcc = "distcc" in mysettings.features
 		if ccache or distcc:
@@ -391,25 +387,27 @@ def doebuild_environment(myebuild, mydo, myroot=None, settings=None,
 				mysettings["PATH"] = os.path.join(os.sep, eprefix_lstrip,
 					 "usr", libdir, "ccache", "bin") + ":" + mysettings["PATH"]
 
-	if not eapi_exports_KV(eapi):
-		# Discard KV for EAPIs that don't support it. Cache KV is restored
-		# from the backupenv whenever config.reset() is called.
-		mysettings.pop('KV', None)
-	elif mydo != 'depend' and 'KV' not in mysettings and \
-		mydo in ('compile', 'config', 'configure', 'info',
-		'install', 'nofetch', 'postinst', 'postrm', 'preinst',
-		'prepare', 'prerm', 'setup', 'test', 'unpack'):
-		mykv, err1 = ExtractKernelVersion(
-			os.path.join(mysettings['EROOT'], "usr/src/linux"))
-		if mykv:
-			# Regular source tree
-			mysettings["KV"] = mykv
-		else:
-			mysettings["KV"] = ""
-		mysettings.backup_changes("KV")
+		if not eapi_exports_KV(eapi):
+			# Discard KV for EAPIs that don't support it. Cached KV is restored
+			# from the backupenv whenever config.reset() is called.
+			mysettings.pop('KV', None)
+		elif 'KV' not in mysettings and \
+			mydo in ('compile', 'config', 'configure', 'info',
+			'install', 'nofetch', 'postinst', 'postrm', 'preinst',
+			'prepare', 'prerm', 'setup', 'test', 'unpack'):
+			mykv, err1 = ExtractKernelVersion(
+				os.path.join(mysettings['EROOT'], "usr/src/linux"))
+			if mykv:
+				# Regular source tree
+				mysettings["KV"] = mykv
+			else:
+				mysettings["KV"] = ""
+			mysettings.backup_changes("KV")
 
-	if mydo != "depend" and not eapi_exports_REPOSITORY(eapi):
-		mysettings.pop('REPOSITORY', None)
+		if eapi_exports_REPOSITORY(eapi) and \
+			"PORTAGE_REPO_NAME" in mysettings.configdict["pkg"]:
+			mysettings.configdict["pkg"]["REPOSITORY"] = \
+				mysettings.configdict["pkg"]["PORTAGE_REPO_NAME"]
 
 _doebuild_manifest_cache = None
 _doebuild_broken_ebuilds = set()



             reply	other threads:[~2012-05-09 22:08 UTC|newest]

Thread overview: 191+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-09 22:08 Zac Medico [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-07-15 21:54 [gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/ Zac Medico
2018-06-23  9:24 Ulrich Müller
2018-05-26  6:09 Zac Medico
2018-05-24 19:45 Zac Medico
2018-05-03 18:48 Zac Medico
2018-03-03 22:24 Zac Medico
2018-02-05 19:25 Michał Górny
2018-01-27 10:19 Michał Górny
2018-01-27 10:19 Michał Górny
2018-01-26 14:59 Michał Górny
2017-11-10  0:32 Zac Medico
2017-11-07 23:14 Michał Górny
2017-07-30  0:07 Zac Medico
2017-03-14 16:30 Michał Górny
2017-03-10  1:46 Zac Medico
2016-11-30  1:10 Zac Medico
2016-09-24  7:23 Zac Medico
2016-09-14 21:39 Zac Medico
2016-09-14 21:28 Zac Medico
2016-06-06 15:50 Zac Medico
2016-02-23 20:32 Zac Medico
2015-12-20 17:39 Michał Górny
2015-12-13 21:27 Zac Medico
2015-12-13 16:54 Zac Medico
2015-12-09 12:37 Arfrever Frehtes Taifersar Arahesis
2015-12-09  1:30 Zac Medico
2015-12-01 17:56 Arfrever Frehtes Taifersar Arahesis
2015-10-08  0:47 Brian Dolbec
2015-04-21 23:52 Zac Medico
2015-03-04 19:29 Zac Medico
2015-03-03 21:26 git@oystercatcher mirror+tproxy
2015-03-03 21:26 Zac Medico
2015-01-31 21:28 Michał Górny
2015-01-30 20:48 Brian Dolbec
2015-01-30 20:48 Brian Dolbec
2014-12-10 20:24 Arfrever Frehtes Taifersar Arahesis
2014-11-05 19:41 Zac Medico
2014-10-22 23:26 Zac Medico
2014-02-17 20:35 Sebastian Luther
2013-09-06 20:10 Zac Medico
2013-08-22  3:57 Zac Medico
2013-08-06 20:02 Zac Medico
2013-07-26 21:01 Zac Medico
2013-07-23 20:27 Zac Medico
2013-07-23 20:09 Arfrever Frehtes Taifersar Arahesis
2013-07-14 18:13 Zac Medico
2013-07-07 19:34 Zac Medico
2013-07-06 22:06 Zac Medico
2013-07-06  1:41 Zac Medico
2013-06-24 20:01 Arfrever Frehtes Taifersar Arahesis
2013-05-18 11:34 Zac Medico
2013-05-03  2:21 Zac Medico
2013-05-03  1:52 Zac Medico
2013-03-27 15:21 Zac Medico
2013-03-27  4:15 Zac Medico
2013-02-27  0:27 Zac Medico
2013-02-18  2:09 Mike Frysinger
2013-02-11 15:29 Zac Medico
2013-02-11  3:06 Zac Medico
2013-02-02  9:03 Zac Medico
2013-01-25 19:49 Zac Medico
2013-01-15 15:16 Zac Medico
2013-01-11  6:56 Zac Medico
2013-01-07  8:41 Zac Medico
2013-01-07  7:12 Zac Medico
2013-01-03 23:55 Zac Medico
2012-12-19 21:48 Zac Medico
2012-12-05 21:19 Zac Medico
2012-12-05 18:02 Zac Medico
2012-10-18  4:58 Zac Medico
2012-10-18  3:43 Zac Medico
2012-10-18  1:56 Zac Medico
2012-10-18  0:50 Zac Medico
2012-10-08 22:07 Zac Medico
2012-09-21 22:17 Zac Medico
2012-09-21 18:01 Zac Medico
2012-09-20  3:38 Zac Medico
2012-09-20  3:14 Zac Medico
2012-09-20  2:36 Zac Medico
2012-09-14  2:24 Zac Medico
2012-08-30 16:43 Zac Medico
2012-08-23 17:10 Zac Medico
2012-07-31 22:02 Zac Medico
2012-07-31 10:21 Zac Medico
2012-06-12  2:00 Zac Medico
2012-06-02  0:13 Zac Medico
2012-06-01 22:51 Zac Medico
2012-06-01 22:12 Zac Medico
2012-05-16 19:44 Zac Medico
2012-05-16  4:55 Zac Medico
2012-05-12  1:34 Zac Medico
2012-05-11 22:54 Zac Medico
2012-05-11 21:04 Zac Medico
2012-05-10 19:56 Arfrever Frehtes Taifersar Arahesis
2012-05-09  8:13 Zac Medico
2012-04-22 22:11 Zac Medico
2012-04-05 19:54 Zac Medico
2012-04-03 15:39 Zac Medico
2012-04-03  6:52 Zac Medico
2012-03-21 19:26 Zac Medico
2012-03-19 18:33 Zac Medico
2012-03-19 17:00 Zac Medico
2012-02-17 21:35 Arfrever Frehtes Taifersar Arahesis
2012-02-13 23:45 Zac Medico
2011-12-22 20:07 Zac Medico
2011-12-22 19:10 Zac Medico
2011-12-20  7:25 Zac Medico
2011-12-13 17:00 Zac Medico
2011-12-10 22:19 Zac Medico
2011-12-10 17:49 Zac Medico
2011-12-10 17:40 Zac Medico
2011-12-10  6:40 Zac Medico
2011-12-10  6:07 Zac Medico
2011-12-09 23:16 Zac Medico
2011-11-29 16:25 Zac Medico
2011-11-26  2:57 Zac Medico
2011-11-18 21:11 Zac Medico
2011-11-18  5:16 Zac Medico
2011-11-18  3:26 Zac Medico
2011-11-09  2:41 Zac Medico
2011-10-29  4:21 Zac Medico
2011-10-28 22:06 Zac Medico
2011-10-28  2:16 Zac Medico
2011-10-28  2:04 Zac Medico
2011-10-24 22:26 Zac Medico
2011-10-18  7:22 Zac Medico
2011-10-18  6:27 Zac Medico
2011-10-14  6:40 Zac Medico
2011-10-14  6:24 Zac Medico
2011-10-13 20:58 Zac Medico
2011-10-11 20:59 Zac Medico
2011-10-11 17:27 Zac Medico
2011-09-28 13:47 Zac Medico
2011-09-27  2:10 Zac Medico
2011-09-23  0:17 Zac Medico
2011-09-17  5:50 Zac Medico
2011-09-15  5:34 Zac Medico
2011-09-15  5:31 Zac Medico
2011-09-15  2:44 Zac Medico
2011-09-14 17:09 Zac Medico
2011-09-14 16:23 Zac Medico
2011-09-13  5:01 Zac Medico
2011-09-13  4:33 Zac Medico
2011-09-12  1:38 Zac Medico
2011-09-01  6:50 Zac Medico
2011-08-31  0:49 Zac Medico
2011-08-30 17:03 Zac Medico
2011-08-29 18:04 Arfrever Frehtes Taifersar Arahesis
2011-08-29  0:05 Zac Medico
2011-08-28 21:05 Zac Medico
2011-08-28 19:55 Arfrever Frehtes Taifersar Arahesis
2011-08-13 12:55 Zac Medico
2011-08-09  0:14 Zac Medico
2011-08-07  5:59 Zac Medico
2011-07-27  9:53 Zac Medico
2011-07-14 21:54 Zac Medico
2011-07-14  1:31 Zac Medico
2011-07-14  1:25 Zac Medico
2011-07-14  0:57 Zac Medico
2011-07-14  0:37 Zac Medico
2011-07-13 17:08 Zac Medico
2011-07-12 23:40 Zac Medico
2011-07-12 20:04 Zac Medico
2011-07-11 16:22 Zac Medico
2011-07-11 15:22 Zac Medico
2011-07-07 17:22 Zac Medico
2011-07-07  7:00 Zac Medico
2011-06-30  7:35 Zac Medico
2011-06-30  6:57 Zac Medico
2011-06-30  2:10 Zac Medico
2011-06-27  2:32 Zac Medico
2011-06-25  5:42 Zac Medico
2011-06-21  0:44 Zac Medico
2011-06-17 19:41 Zac Medico
2011-06-17 19:27 Zac Medico
2011-06-16 19:27 Zac Medico
2011-06-13 15:26 Zac Medico
2011-06-13 13:41 Zac Medico
2011-06-11  0:02 Arfrever Frehtes Taifersar Arahesis
2011-06-09 13:58 Zac Medico
2011-06-09 13:14 Zac Medico
2011-06-06 10:30 Zac Medico
2011-06-06 10:10 Zac Medico
2011-06-06  9:11 Zac Medico
2011-05-24  3:02 Zac Medico
2011-05-09 22:34 Zac Medico
2011-04-28 21:32 Zac Medico
2011-03-04 16:41 Zac Medico
2011-02-04 17:23 zmedico
2011-02-04 17:18 zmedico

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1336601288.1c26d24dfc869a6f5ef426f7c02e1d25abcda34e.zmedico@gentoo \
    --to=zmedico@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox