From c07a9eee5040025d68121e41943929a96e0421c4 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 11 Nov 2008 19:59:49 +0000 Subject: Make post_emerge() exit early if it detects that the vdb state hasn't changed. This works by comparing a hash of the COUNTER values for all packages in the vdb. svn path=/main/trunk/; revision=11859 --- pym/_emerge/__init__.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'pym/_emerge/__init__.py') diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index c5084ac7b..14a63a492 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -11236,6 +11236,12 @@ def post_emerge(root_config, myopts, mtimedb, retval): _flush_elog_mod_echo() + counter_hash = settings.get("PORTAGE_COUNTER_HASH") + if counter_hash is not None and \ + counter_hash == vardbapi._counter_hash(): + # If vdb state has not changed then there's nothing else to do. + sys.exit(retval) + vdb_path = os.path.join(target_root, portage.VDB_PATH) portage.util.ensure_dirs(vdb_path) vdb_lock = None @@ -13830,6 +13836,9 @@ def emerge_main(): mysettings = trees[myroot]["vartree"].settings mysettings.unlock() adjust_config(myopts, mysettings) + mysettings["PORTAGE_COUNTER_HASH"] = \ + trees[myroot]["vartree"].dbapi._counter_hash() + mysettings.backup_changes("PORTAGE_COUNTER_HASH") mysettings.lock() del myroot, mysettings -- cgit v1.2.3-1-g7c22