commit:     31923f4ee2d89d840b3bc31af774352ef626648d
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Wed Dec  9 12:35:04 2015 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> apache <DOT> org>
CommitDate: Wed Dec  9 12:35:04 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=31923f4e

portage.package.ebuild.config.config.__init__(): Skip some warnings for Portage 
Python scripts called in ebuild environment.

 pym/portage/package/ebuild/config.py | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/pym/portage/package/ebuild/config.py 
b/pym/portage/package/ebuild/config.py
index 50e0110..f75a0e7 100644
--- a/pym/portage/package/ebuild/config.py
+++ b/pym/portage/package/ebuild/config.py
@@ -510,12 +510,15 @@ class config(object):
                                if make_conf.get(var) is not None:
                                        writemsg_level("!!! %s\n" % _("%s 
variable is set in make.conf but is no longer used. "
                                                "Use repos.conf instead.") % 
var, level=logging.WARNING, noiselevel=-1)
-                       for var in ("PORTDIR", "PORTDIR_OVERLAY", "SYNC"):
-                               if self.configdict["env"].get(var) is not None:
-                                       writemsg_level("!!! %s\n" % _("%s 
environmental variable is set but is no longer used. "
-                                               "Use new environmental 
variables instead:") % var, level=logging.WARNING, noiselevel=-1)
-                                       writemsg_level("    
PORTAGE_REPOSITORIES, PORTAGE_REPOSITORY:${repository_name}:${attribute}, "
-                                               "PORTAGE_ADDED_REPOSITORIES, 
PORTAGE_DELETED_REPOSITORIES\n", level=logging.WARNING, noiselevel=-1)
+                       # Skip warnings for Portage Python scripts called in 
ebuild environment.
+                       # PORTDIR is exported in ebuild environment in some 
EAPIs.
+                       if self.configdict["env"].get("EBUILD") is None:
+                               for var in ("PORTDIR", "PORTDIR_OVERLAY", 
"SYNC"):
+                                       if self.configdict["env"].get(var) is 
not None:
+                                               writemsg_level("!!! %s\n" % 
_("%s environmental variable is set but is no longer used. "
+                                                       "Use new environmental 
variables instead:") % var, level=logging.WARNING, noiselevel=-1)
+                                               writemsg_level("    
PORTAGE_REPOSITORIES, PORTAGE_REPOSITORY:${repository_name}:${attribute}, "
+                                                       
"PORTAGE_ADDED_REPOSITORIES, PORTAGE_DELETED_REPOSITORIES\n", 
level=logging.WARNING, noiselevel=-1)
 
                        self.lookuplist = [self.configdict["env"]]
                        if repositories is None:

Reply via email to