support suppressing env-update
BUG=chromium-os:11316
TEST=Compile with build_packages --nousepkg
http://codereview.chromium.org/6370011
https://gerrit.chromium.org/gerrit/42995
Change-Id: I34944b7a650f0e3de0a54a28e911e464ab8cfd52
Reviewed-on: https://chromium-review.googlesource.com/214523
Reviewed-by: Bertrand Simonnet <bsimonnet@chromium.org>
Tested-by: Bertrand Simonnet <bsimonnet@chromium.org>
diff --git a/pym/portage/const.py b/pym/portage/const.py
index aab6e8a..f2e69e0 100644
--- a/pym/portage/const.py
+++ b/pym/portage/const.py
@@ -157,6 +157,7 @@
"multilib-strict",
"network-sandbox",
"news",
+ "no-env-update",
"noauto",
"noclean",
"nodoc",
diff --git a/pym/portage/util/env_update.py b/pym/portage/util/env_update.py
index c0a93a8..f4cccc9 100644
--- a/pym/portage/util/env_update.py
+++ b/pym/portage/util/env_update.py
@@ -43,6 +43,14 @@
defaults to portage.settings["ROOT"].
@type target_root: String (Path)
"""
+ settings = getattr(portage, 'settings', None)
+ if settings is None:
+ settings = config(config_root=target_root,
+ target_root=target_root)
+
+ if 'no-env-update' in settings.features:
+ return
+
if vardbapi is None:
if isinstance(env, config):
vardbapi = vartree(settings=env).dbapi