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/, pym/portage/dbapi/, pym/_emerge/
Date: Mon, 11 Jun 2012 23:08:33 +0000 (UTC)	[thread overview]
Message-ID: <1339456101.dd340e4492adc2377ebff566b5897facd234ec11.zmedico@gentoo> (raw)

commit:     dd340e4492adc2377ebff566b5897facd234ec11
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 11 23:08:21 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Jun 11 23:08:21 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=dd340e44

Move post_src_install metadata code to one func.

---
 pym/_emerge/EbuildPhase.py             |    4 +-
 pym/portage/dbapi/bintree.py           |    1 -
 pym/portage/package/ebuild/doebuild.py |   77 +++++++++++++++----------------
 3 files changed, 39 insertions(+), 43 deletions(-)

diff --git a/pym/_emerge/EbuildPhase.py b/pym/_emerge/EbuildPhase.py
index 741f608..fe44abc 100644
--- a/pym/_emerge/EbuildPhase.py
+++ b/pym/_emerge/EbuildPhase.py
@@ -27,9 +27,9 @@ portage.proxy.lazyimport.lazyimport(globals(),
 	'portage.elog:messages@elog_messages',
 	'portage.package.ebuild.doebuild:_check_build_log,' + \
 		'_post_phase_cmds,_post_phase_userpriv_perms,' + \
-		'_post_src_install_chost_fix,' + \
 		'_post_src_install_soname_symlinks,' + \
 		'_post_src_install_uid_fix,_postinst_bsdflags,' + \
+		'_post_src_install_write_metadata,' + \
 		'_preinst_bsdflags'
 )
 from portage import os
@@ -215,7 +215,7 @@ class EbuildPhase(CompositeTask):
 
 		if self.phase == "install":
 			out = io.StringIO()
-			_post_src_install_chost_fix(settings)
+			_post_src_install_write_metadata(settings)
 			_post_src_install_uid_fix(settings, out)
 			msg = out.getvalue()
 			if msg:

diff --git a/pym/portage/dbapi/bintree.py b/pym/portage/dbapi/bintree.py
index a8027ee..fb31572 100644
--- a/pym/portage/dbapi/bintree.py
+++ b/pym/portage/dbapi/bintree.py
@@ -10,7 +10,6 @@ portage.proxy.lazyimport.lazyimport(globals(),
 	'portage.dep:dep_getkey,isjustname,match_from_list',
 	'portage.output:EOutput,colorize',
 	'portage.locks:lockfile,unlockfile',
-	'portage.package.ebuild.doebuild:_vdb_use_conditional_atoms',
 	'portage.package.ebuild.fetch:_check_distfile,_hide_url_passwd',
 	'portage.update:update_dbentries',
 	'portage.util:atomic_ofstream,ensure_dirs,normalize_path,' + \

diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py
index bb2c2e0..edc5d0b 100644
--- a/pym/portage/package/ebuild/doebuild.py
+++ b/pym/portage/package/ebuild/doebuild.py
@@ -1623,7 +1623,7 @@ def _check_build_log(mysettings, out=None):
 	if f_real is not None:
 		f_real.close()
 
-def _post_src_install_chost_fix(settings):
+def _post_src_install_write_metadata(settings):
 	"""
 	It's possible that the ebuild has changed the
 	CHOST variable, so revert it to the initial
@@ -1646,9 +1646,44 @@ def _post_src_install_chost_fix(settings):
 			if v is not None:
 				write_atomic(os.path.join(build_info_dir, k), v + '\n')
 
+	with io.open(_unicode_encode(os.path.join(build_info_dir,
+		'BUILD_TIME'), encoding=_encodings['fs'], errors='strict'),
+		mode='w', encoding=_encodings['repo.content'],
+		errors='strict') as f:
+		f.write(_unicode_decode("%.0f\n" % (time.time(),)))
+
+	use = frozenset(settings['PORTAGE_USE'].split())
+	for k in _vdb_use_conditional_keys:
+		v = settings.configdict['pkg'].get(k)
+		filename = os.path.join(build_info_dir, k)
+		if v is None:
+			try:
+				os.unlink(filename)
+			except OSError:
+				pass
+			continue
+
+		if k.endswith('DEPEND'):
+			token_class = Atom
+		else:
+			token_class = None
+
+		v = use_reduce(v, uselist=use, token_class=token_class)
+		v = paren_enclose(v)
+		if not v:
+			try:
+				os.unlink(filename)
+			except OSError:
+				pass
+			continue
+		with io.open(_unicode_encode(os.path.join(build_info_dir,
+			k), encoding=_encodings['fs'], errors='strict'),
+			mode='w', encoding=_encodings['repo.content'],
+			errors='strict') as f:
+			f.write(_unicode_decode(v + '\n'))
+
 _vdb_use_conditional_keys = ('DEPEND', 'LICENSE', 'PDEPEND',
 	'PROPERTIES', 'PROVIDE', 'RDEPEND', 'RESTRICT',)
-_vdb_use_conditional_atoms = frozenset(['DEPEND', 'PDEPEND', 'RDEPEND'])
 
 def _preinst_bsdflags(mysettings):
 	if bsd_chflags:
@@ -1817,44 +1852,6 @@ def _post_src_install_uid_fix(mysettings, out):
 	f.write(_unicode_decode(str(size) + '\n'))
 	f.close()
 
-	f = io.open(_unicode_encode(os.path.join(build_info_dir,
-		'BUILD_TIME'), encoding=_encodings['fs'], errors='strict'),
-		mode='w', encoding=_encodings['repo.content'],
-		errors='strict')
-	f.write(_unicode_decode("%.0f\n" % (time.time(),)))
-	f.close()
-
-	use = frozenset(mysettings['PORTAGE_USE'].split())
-	for k in _vdb_use_conditional_keys:
-		v = mysettings.configdict['pkg'].get(k)
-		filename = os.path.join(build_info_dir, k)
-		if v is None:
-			try:
-				os.unlink(filename)
-			except OSError:
-				pass
-			continue
-
-		if k.endswith('DEPEND'):
-			token_class = Atom
-		else:
-			token_class = None
-
-		v = use_reduce(v, uselist=use, token_class=token_class)
-		v = paren_enclose(v)
-		if not v:
-			try:
-				os.unlink(filename)
-			except OSError:
-				pass
-			continue
-		f = io.open(_unicode_encode(os.path.join(build_info_dir,
-			k), encoding=_encodings['fs'], errors='strict'),
-			mode='w', encoding=_encodings['repo.content'],
-			errors='strict')
-		f.write(_unicode_decode(v + '\n'))
-		f.close()
-
 	_reapply_bsdflags_to_image(mysettings)
 
 def _reapply_bsdflags_to_image(mysettings):



             reply	other threads:[~2012-06-11 23:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-11 23:08 Zac Medico [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-07-25 21:54 [gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/, pym/portage/dbapi/, pym/_emerge/ Zac Medico
2013-01-04  2:23 Zac Medico
2012-01-14 15:30 Zac Medico
2011-10-18  5:45 Zac Medico

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=1339456101.dd340e4492adc2377ebff566b5897facd234ec11.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