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/, pym/_emerge/
Date: Sat, 15 Oct 2011 06:11:17 +0000 (UTC)	[thread overview]
Message-ID: <0c1bbb316ce2e7e9608af78f5e2f5dea1c667af7.zmedico@gentoo> (raw)

commit:     0c1bbb316ce2e7e9608af78f5e2f5dea1c667af7
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 15 06:11:02 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Oct 15 06:11:02 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0c1bbb31

emerge --metadata: fix empty INHERITED handling

Since changes to eclass validation code in commit
2ed1cb53cc4158af08c22d466b15b9a9a7767212, validation of cache for
packages with empty INHERITED metadata has been broken due to failure
to distinguish between None and empty dict return values from
eclass.cache.validate_and_rewrite_cache().

---
 pym/_emerge/actions.py      |    6 +++---
 pym/portage/eclass_cache.py |    5 +++++
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 71a0902..0879510 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -1743,7 +1743,7 @@ def action_metadata(settings, portdb, myopts, porttrees=None):
 					if not (dest['_mtime_'] == src['_mtime_'] and \
 						tree_data.eclass_db.validate_and_rewrite_cache(
 							dest['_eclasses_'], tree_data.dest_db.validation_chf,
-							tree_data.dest_db.store_eclass_paths) and \
+							tree_data.dest_db.store_eclass_paths) is not None and \
 						set(dest['_eclasses_']) == set(src['_eclasses_'])):
 						dest = None
 					else:
@@ -1768,9 +1768,9 @@ def action_metadata(settings, portdb, myopts, porttrees=None):
 					continue
 
 				if eclasses is not None:
-					if not tree_data.eclass_db.validate_and_rewrite_cache(
+					if tree_data.eclass_db.validate_and_rewrite_cache(
 						src['_eclasses_'], tree_data.src_db.validation_chf,
-						tree_data.src_db.store_eclass_paths):
+						tree_data.src_db.store_eclass_paths) is None:
 						continue
 					inherited = eclasses
 				else:

diff --git a/pym/portage/eclass_cache.py b/pym/portage/eclass_cache.py
index 2f6e947..808662b 100644
--- a/pym/portage/eclass_cache.py
+++ b/pym/portage/eclass_cache.py
@@ -133,6 +133,11 @@ class cache(object):
 				self._eclass_locations[ys] = x
 
 	def validate_and_rewrite_cache(self, ec_dict, chf_type, stores_paths):
+		"""
+		This will return an empty dict if the ec_dict parameter happens
+		to be empty, therefore callers must take care to distinguish
+		between empty dict and None return values.
+		"""
 		if not isinstance(ec_dict, dict):
 			return None
 		our_getter = operator.attrgetter(chf_type)



             reply	other threads:[~2011-10-15  6:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-15  6:11 Zac Medico [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-08-12 21:25 [gentoo-commits] proj/portage:master commit in: pym/portage/, pym/_emerge/ Zac Medico
2013-07-22 22:32 Arfrever Frehtes Taifersar Arahesis
2012-09-26  2:15 Zac Medico
2012-09-21 18:40 Zac Medico
2012-06-11  5:58 Zac Medico
2012-06-11  5:32 Zac Medico
2012-06-11  0:58 Zac Medico
2011-10-27  3:13 Zac Medico
2011-10-25  8:25 Zac Medico
2011-07-12 23:21 Zac Medico
2011-07-07  4:36 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=0c1bbb316ce2e7e9608af78f5e2f5dea1c667af7.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