From 08b350a53b52adb18947ce2f1ffc56a8d59b02ba Mon Sep 17 00:00:00 2001
From: Zac Medico <zmedico@gentoo.org>
Date: Sat, 8 Sep 2012 13:31:50 -0700
Subject: [PATCH] egencache: tweak metadata-transfer logic

Now is won't force metadata-transfer unless it's absolutely necessary.
---
 bin/egencache | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/bin/egencache b/bin/egencache
index 1b4fa0cb8..f7b447130 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -881,20 +881,14 @@ def egencache_main(args):
 			return 1
 
 	if options.update and 'metadata-transfer' not in settings.features:
-		metadata_transfer = True
+		# Forcibly enable metadata-transfer if portdbapi has a pregenerated
+		# cache that does not support eclass validation.
 		repo_config = settings.repositories.get_repo_for_location(repo_path)
 		cache = repo_config.get_pregenerated_cache(
 			portage.dbapi.dbapi._known_keys, readonly=True)
-		if cache is not None:
-			if cache.complete_eclass_entries:
-				# If the portdbapi's pregenerated cache supports eclass
-				# validation, then there's no need to forcibly enable
-				# metadata-transfer.
-				metadata_transfer = False
-			cache = None
-
-		if metadata_transfer:
+		if cache is not None and not cache.complete_eclass_entries:
 			settings.features.add('metadata-transfer')
+		cache = None
 
 	settings.lock()
 
-- 
2.26.2