public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/portage:master commit in: pym/portage/dbapi/, bin/, pym/portage/, pym/portage/dep/, pym/_emerge/
@ 2013-01-03 23:04 Zac Medico
  0 siblings, 0 replies; only message in thread
From: Zac Medico @ 2013-01-03 23:04 UTC (permalink / raw
  To: gentoo-commits

commit:     cbbab21dfdd9bee79cddaaac12d7ea5890674d81
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Jan  3 23:04:40 2013 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Jan  3 23:04:40 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=cbbab21d

Add portage._internal_caller var, and use it.

---
 bin/archive-conf              |    3 ++-
 bin/binhost-snapshot          |    3 ++-
 bin/clean_locks               |    3 ++-
 bin/dispatch-conf             |    3 ++-
 bin/ebuild                    |    4 ++--
 bin/ebuild-ipc.py             |    3 ++-
 bin/egencache                 |    3 ++-
 bin/emaint                    |    3 ++-
 bin/emerge                    |    5 ++++-
 bin/env-update                |    3 ++-
 bin/fixpackages               |    3 ++-
 bin/glsa-check                |    3 ++-
 bin/lock-helper.py            |    3 ++-
 bin/portageq                  |    3 ++-
 bin/quickpkg                  |    3 ++-
 bin/regenworld                |    3 ++-
 bin/repoman                   |    4 ++--
 bin/xpak-helper.py            |    3 ++-
 pym/_emerge/main.py           |    4 +---
 pym/portage/__init__.py       |    4 ++--
 pym/portage/dbapi/porttree.py |    4 ++--
 pym/portage/dep/__init__.py   |   12 ++++++------
 22 files changed, 49 insertions(+), 33 deletions(-)

diff --git a/bin/archive-conf b/bin/archive-conf
index 80fa308..2c10884 100755
--- a/bin/archive-conf
+++ b/bin/archive-conf
@@ -1,5 +1,5 @@
 #!/usr/bin/python
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 #
@@ -17,6 +17,7 @@ from os import path as osp
 pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")
 sys.path.insert(0, pym_path)
 import portage
+portage._internal_caller = True
 
 from portage import os
 from portage import dispatch_conf

diff --git a/bin/binhost-snapshot b/bin/binhost-snapshot
index fe2cf6b..e9bd45a 100755
--- a/bin/binhost-snapshot
+++ b/bin/binhost-snapshot
@@ -1,5 +1,5 @@
 #!/usr/bin/python
-# Copyright 2010-2012 Gentoo Foundation
+# Copyright 2010-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import io
@@ -17,6 +17,7 @@ from os import path as osp
 pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")
 sys.path.insert(0, pym_path)
 import portage
+portage._internal_caller = True
 
 def parse_args(argv):
 	prog_name = os.path.basename(argv[0])

diff --git a/bin/clean_locks b/bin/clean_locks
index 09ee3e5..0a97918 100755
--- a/bin/clean_locks
+++ b/bin/clean_locks
@@ -1,5 +1,5 @@
 #!/usr/bin/python -O
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import print_function
@@ -9,6 +9,7 @@ from os import path as osp
 pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")
 sys.path.insert(0, pym_path)
 import portage
+portage._internal_caller = True
 from portage import os
 
 if not sys.argv[1:] or "--help" in sys.argv or "-h" in sys.argv:

diff --git a/bin/dispatch-conf b/bin/dispatch-conf
index 479647e..e44c0ea 100755
--- a/bin/dispatch-conf
+++ b/bin/dispatch-conf
@@ -1,5 +1,5 @@
 #!/usr/bin/python -O
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 #
@@ -20,6 +20,7 @@ from os import path as osp
 pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")
 sys.path.insert(0, pym_path)
 import portage
+portage._internal_caller = True
 from portage import os
 from portage import dispatch_conf
 from portage import _unicode_decode

diff --git a/bin/ebuild b/bin/ebuild
index 36580bf..754b9a9 100755
--- a/bin/ebuild
+++ b/bin/ebuild
@@ -1,5 +1,5 @@
 #!/usr/bin/python -O
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import print_function
@@ -68,7 +68,7 @@ from os import path as osp
 pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")
 sys.path.insert(0, pym_path)
 import portage
-portage._internal_warnings = True
+portage._internal_caller = True
 from portage import os
 from portage import _encodings
 from portage import _shell_quote

diff --git a/bin/ebuild-ipc.py b/bin/ebuild-ipc.py
index 3caf2d1..52ea05c 100755
--- a/bin/ebuild-ipc.py
+++ b/bin/ebuild-ipc.py
@@ -1,5 +1,5 @@
 #!/usr/bin/python
-# Copyright 2010-2012 Gentoo Foundation
+# Copyright 2010-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 #
 # This is a helper which ebuild processes can use
@@ -38,6 +38,7 @@ if os.environ.get("SANDBOX_ON") == "1":
 			":".join(filter(None, sandbox_write))
 
 import portage
+portage._internal_caller = True
 portage._disable_legacy_globals()
 
 class EbuildIpc(object):

diff --git a/bin/egencache b/bin/egencache
index 110c47d..87673a0 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -1,5 +1,5 @@
 #!/usr/bin/python
-# Copyright 2009-2012 Gentoo Foundation
+# Copyright 2009-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import print_function
@@ -44,6 +44,7 @@ from os import path as osp
 pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")
 sys.path.insert(0, pym_path)
 import portage
+portage._internal_caller = True
 from portage import os, _encodings, _unicode_encode, _unicode_decode
 from _emerge.MetadataRegen import MetadataRegen
 from portage.cache.cache_errors import CacheError, StatCollision

diff --git a/bin/emaint b/bin/emaint
index fd9f346..bc1b92f 100755
--- a/bin/emaint
+++ b/bin/emaint
@@ -1,5 +1,5 @@
 #!/usr/bin/python -O
-# Copyright 2005-2012 Gentoo Foundation
+# Copyright 2005-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 """'The emaint program provides an interface to system health
@@ -30,6 +30,7 @@ from os import path as osp
 pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")
 sys.path.insert(0, pym_path)
 import portage
+portage._internal_caller = True
 from portage.emaint.main import emaint_main
 
 try:

diff --git a/bin/emerge b/bin/emerge
index b749b0a..fc85d58 100755
--- a/bin/emerge
+++ b/bin/emerge
@@ -1,5 +1,5 @@
 #!/usr/bin/python
-# Copyright 2006-2012 Gentoo Foundation
+# Copyright 2006-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import print_function
@@ -39,6 +39,9 @@ try:
 	pym_path = osp.join(osp.dirname(osp.dirname(
 		osp.realpath(__file__))), "pym")
 	sys.path.insert(0, pym_path)
+	import portage
+	portage._internal_caller = True
+	portage._disable_legacy_globals()
 	from _emerge.main import emerge_main
 
 	if __name__ == "__main__":

diff --git a/bin/env-update b/bin/env-update
index cee3fd6..b500c54 100755
--- a/bin/env-update
+++ b/bin/env-update
@@ -1,5 +1,5 @@
 #!/usr/bin/python -O
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import print_function
@@ -29,6 +29,7 @@ from os import path as osp
 pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")
 sys.path.insert(0, pym_path)
 import portage
+portage._internal_caller = True
 
 try:
 	portage.env_update(makelinks)

diff --git a/bin/fixpackages b/bin/fixpackages
index da08520..e224b62 100755
--- a/bin/fixpackages
+++ b/bin/fixpackages
@@ -1,5 +1,5 @@
 #!/usr/bin/python
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import print_function
@@ -11,6 +11,7 @@ from os import path as osp
 pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")
 sys.path.insert(0, pym_path)
 import portage
+portage._internal_caller = True
 from portage import os
 from portage.output import EOutput
 from textwrap import wrap

diff --git a/bin/glsa-check b/bin/glsa-check
index b3eb146..ed0df35 100755
--- a/bin/glsa-check
+++ b/bin/glsa-check
@@ -1,5 +1,5 @@
 #!/usr/bin/python
-# Copyright 2008-2012 Gentoo Foundation
+# Copyright 2008-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import print_function
@@ -10,6 +10,7 @@ from os import path as osp
 pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")
 sys.path.insert(0, pym_path)
 import portage
+portage._internal_caller = True
 from portage import os
 from portage.output import *
 

diff --git a/bin/lock-helper.py b/bin/lock-helper.py
index dfb8876..128e4dd 100755
--- a/bin/lock-helper.py
+++ b/bin/lock-helper.py
@@ -1,11 +1,12 @@
 #!/usr/bin/python
-# Copyright 2010-2011 Gentoo Foundation
+# Copyright 2010-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import os
 import sys
 sys.path.insert(0, os.environ['PORTAGE_PYM_PATH'])
 import portage
+portage._internal_caller = True
 portage._disable_legacy_globals()
 
 def main(args):

diff --git a/bin/portageq b/bin/portageq
index 7b5c2cd..ee776ef 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -1,5 +1,5 @@
 #!/usr/bin/python -O
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import print_function
@@ -36,6 +36,7 @@ if os.environ.get("SANDBOX_ON") == "1":
 
 sys.path.insert(0, pym_path)
 import portage
+portage._internal_caller = True
 from portage import os
 from portage.eapi import eapi_has_repo_deps
 from portage.util import writemsg, writemsg_stdout

diff --git a/bin/quickpkg b/bin/quickpkg
index a6439e2..19d90b0 100755
--- a/bin/quickpkg
+++ b/bin/quickpkg
@@ -1,5 +1,5 @@
 #!/usr/bin/python
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import print_function
@@ -15,6 +15,7 @@ from os import path as osp
 pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")
 sys.path.insert(0, pym_path)
 import portage
+portage._internal_caller = True
 from portage import os
 from portage import xpak
 from portage.dbapi.dep_expand import dep_expand

diff --git a/bin/regenworld b/bin/regenworld
index a283344..f74b3dd 100755
--- a/bin/regenworld
+++ b/bin/regenworld
@@ -1,5 +1,5 @@
 #!/usr/bin/python
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import print_function
@@ -9,6 +9,7 @@ from os import path as osp
 pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")
 sys.path.insert(0, pym_path)
 import portage
+portage._internal_caller = True
 from portage import os
 from portage._sets.files import StaticFileSet, WorldSelectedSet
 

diff --git a/bin/repoman b/bin/repoman
index 57ddf72..4c00d5b 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -1,5 +1,5 @@
 #!/usr/bin/python -O
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 # Next to do: dep syntax checking in mask files
@@ -38,8 +38,8 @@ from os import path as osp
 pym_path = osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")
 sys.path.insert(0, pym_path)
 import portage
+portage._internal_caller = True
 portage._disable_legacy_globals()
-portage._internal_warnings = True
 
 try:
 	import xml.etree.ElementTree

diff --git a/bin/xpak-helper.py b/bin/xpak-helper.py
index ef74920..7a3865c 100755
--- a/bin/xpak-helper.py
+++ b/bin/xpak-helper.py
@@ -1,10 +1,11 @@
 #!/usr/bin/python
-# Copyright 2009-2011 Gentoo Foundation
+# Copyright 2009-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import optparse
 import sys
 import portage
+portage._internal_caller = True
 from portage import os
 
 def command_recompose(args):

diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index 96d6a16..c0e2d96 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import print_function
@@ -999,8 +999,6 @@ def emerge_main(args=None):
 	if args is None:
 		args = sys.argv[1:]
 
-	portage._disable_legacy_globals()
-	portage._internal_warnings = True
 	# Disable color until we're sure that it should be enabled (after
 	# EMERGE_DEFAULT_OPTS has been parsed).
 	portage.output.havecolor = 0

diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index 96a4fa9..169c197 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -1,5 +1,5 @@
 # portage.py -- core Portage functionality
-# Copyright 1998-2012 Gentoo Foundation
+# Copyright 1998-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 VERSION="HEAD"
@@ -335,7 +335,7 @@ _bin_path = PORTAGE_BIN_PATH
 _pym_path = PORTAGE_PYM_PATH
 
 # Api consumers included in portage should set this to True.
-_internal_warnings = False
+_internal_caller = False
 
 _sync_disabled_warnings = False
 

diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py
index ebb1be8..d8cd261 100644
--- a/pym/portage/dbapi/porttree.py
+++ b/pym/portage/dbapi/porttree.py
@@ -1,4 +1,4 @@
-# Copyright 1998-2012 Gentoo Foundation
+# Copyright 1998-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 __all__ = [
@@ -197,7 +197,7 @@ class portdbapi(dbapi):
 
 	@property
 	def _event_loop(self):
-		if portage._internal_warnings:
+		if portage._internal_caller:
 			# For internal portage usage, the global_event_loop is safe.
 			return global_event_loop()
 		else:

diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py
index 634b42b..916d5ea 100644
--- a/pym/portage/dep/__init__.py
+++ b/pym/portage/dep/__init__.py
@@ -1,5 +1,5 @@
 # deps.py -- Portage dependency resolution functions
-# Copyright 2003-2012 Gentoo Foundation
+# Copyright 2003-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 __all__ = [
@@ -269,7 +269,7 @@ def paren_reduce(mystr):
 	@rtype: Array
 	@return: The reduced string in an array
 	"""
-	if portage._internal_warnings:
+	if portage._internal_caller:
 		warnings.warn(_("%s is deprecated and will be removed without replacement.") % \
 			('portage.dep.paren_reduce',), DeprecationWarning, stacklevel=2)
 	mysplit = mystr.split()
@@ -361,7 +361,7 @@ class paren_normalize(list):
 	"""Take a dependency structure as returned by paren_reduce or use_reduce
 	and generate an equivalent structure that has no redundant lists."""
 	def __init__(self, src):
-		if portage._internal_warnings:
+		if portage._internal_caller:
 			warnings.warn(_("%s is deprecated and will be removed without replacement.") % \
 				('portage.dep.paren_normalize',), DeprecationWarning, stacklevel=2)
 		list.__init__(self)
@@ -457,7 +457,7 @@ def use_reduce(depstr, uselist=[], masklist=[], matchall=False, excludeall=[], i
 	@return: The use reduced depend array
 	"""
 	if isinstance(depstr, list):
-		if portage._internal_warnings:
+		if portage._internal_caller:
 			warnings.warn(_("Passing paren_reduced dep arrays to %s is deprecated. " + \
 				"Pass the original dep string instead.") % \
 				('portage.dep.use_reduce',), DeprecationWarning, stacklevel=2)
@@ -758,7 +758,7 @@ def dep_opconvert(deplist):
 	@return:
 		The new list with the new ordering
 	"""
-	if portage._internal_warnings:
+	if portage._internal_caller:
 		warnings.warn(_("%s is deprecated. Use %s with the opconvert parameter set to True instead.") % \
 			('portage.dep.dep_opconvert', 'portage.dep.use_reduce'), DeprecationWarning, stacklevel=2)
 
@@ -789,7 +789,7 @@ def flatten(mylist):
 	@rtype: List
 	@return: A single list containing only non-list elements.
 	"""
-	if portage._internal_warnings:
+	if portage._internal_caller:
 		warnings.warn(_("%s is deprecated and will be removed without replacement.") % \
 			('portage.dep.flatten',), DeprecationWarning, stacklevel=2)
 


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-01-03 23:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-03 23:04 [gentoo-commits] proj/portage:master commit in: pym/portage/dbapi/, bin/, pym/portage/, pym/portage/dep/, pym/_emerge/ Zac Medico

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox