_prepare_self_update: detect if already called v2.2.0_alpha76
authorZac Medico <zmedico@gentoo.org>
Fri, 18 Nov 2011 21:11:05 +0000 (13:11 -0800)
committerZac Medico <zmedico@gentoo.org>
Fri, 18 Nov 2011 21:11:05 +0000 (13:11 -0800)
This is should never be triggered by portage, but it's possible that
an API consumer might trigger it somehow.

pym/portage/package/ebuild/doebuild.py

index 9e71cfc68845e27e2c874ee72e55bc006bb5cfd5..4ba523cc4624bf314915be7ad5742ac55a2eb341 100644 (file)
@@ -2024,6 +2024,10 @@ def _prepare_self_update(settings):
        automatically clean up the temporary copies.
        """
 
+       # sanity check: ensure that that this routine only runs once
+       if portage._bin_path != portage.const.PORTAGE_BIN_PATH:
+               return
+
        # Load lazily referenced portage submodules into memory,
        # so imports won't fail during portage upgrade/downgrade.
        _preload_elog_modules(settings)