From 3b29e2d13c21d3f72712a3f2a67b2894049776e4 Mon Sep 17 00:00:00 2001 From: Fabian Groffen Date: Mon, 26 Feb 2007 21:16:35 +0000 Subject: [PATCH] Merged from trunk 2980:5981 (prefix: now also using the emulation for non-modularised situation) Replace compat symlinks with a new compat module as the symlink solution prevents reuse of state information (requested by ferringb) svn path=/main/branches/prefix/; revision=6077 --- pym/cvstree.py | 35 +++++++++++++++++++++++++++++++++ pym/eclass_cache.py | 35 +++++++++++++++++++++++++++++++++ pym/emergehelp.py | 35 +++++++++++++++++++++++++++++++++ pym/getbinpkg.py | 35 +++++++++++++++++++++++++++++++++ pym/output.py | 35 +++++++++++++++++++++++++++++++++ pym/portage_checksum.py | 35 +++++++++++++++++++++++++++++++++ pym/portage_compat_namespace.py | 35 +++++++++++++++++++++++++++++++++ pym/portage_const.py | 35 +++++++++++++++++++++++++++++++++ pym/portage_data.py | 35 +++++++++++++++++++++++++++++++++ pym/portage_debug.py | 35 +++++++++++++++++++++++++++++++++ pym/portage_dep.py | 35 +++++++++++++++++++++++++++++++++ pym/portage_exception.py | 35 +++++++++++++++++++++++++++++++++ pym/portage_exec.py | 15 ++++++++++++++ pym/portage_gpg.py | 35 +++++++++++++++++++++++++++++++++ pym/portage_localization.py | 35 +++++++++++++++++++++++++++++++++ pym/portage_locks.py | 35 +++++++++++++++++++++++++++++++++ pym/portage_mail.py | 35 +++++++++++++++++++++++++++++++++ pym/portage_manifest.py | 35 +++++++++++++++++++++++++++++++++ pym/portage_news.py | 35 +++++++++++++++++++++++++++++++++ pym/portage_selinux.py | 35 +++++++++++++++++++++++++++++++++ pym/portage_update.py | 35 +++++++++++++++++++++++++++++++++ pym/portage_util.py | 35 +++++++++++++++++++++++++++++++++ pym/portage_versions.py | 35 +++++++++++++++++++++++++++++++++ pym/xpak.py | 35 +++++++++++++++++++++++++++++++++ 24 files changed, 820 insertions(+) create mode 100644 pym/cvstree.py create mode 100644 pym/eclass_cache.py create mode 100644 pym/emergehelp.py create mode 100644 pym/getbinpkg.py create mode 100644 pym/output.py create mode 100644 pym/portage_checksum.py create mode 100644 pym/portage_compat_namespace.py create mode 100644 pym/portage_const.py create mode 100644 pym/portage_data.py create mode 100644 pym/portage_debug.py create mode 100644 pym/portage_dep.py create mode 100644 pym/portage_exception.py create mode 100644 pym/portage_exec.py create mode 100644 pym/portage_gpg.py create mode 100644 pym/portage_localization.py create mode 100644 pym/portage_locks.py create mode 100644 pym/portage_mail.py create mode 100644 pym/portage_manifest.py create mode 100644 pym/portage_news.py create mode 100644 pym/portage_selinux.py create mode 100644 pym/portage_update.py create mode 100644 pym/portage_util.py create mode 100644 pym/portage_versions.py create mode 100644 pym/xpak.py diff --git a/pym/cvstree.py b/pym/cvstree.py new file mode 100644 index 000000000..ee2b71285 --- /dev/null +++ b/pym/cvstree.py @@ -0,0 +1,35 @@ +# portage_compat_namespace.py -- provide compability layer with new namespace +# Copyright 2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id: portage_compat_namespace.py 5981 2007-02-17 13:11:28Z genone $ + +""" +This module checks the name under which it is imported and attempts to load +the corresponding module of the new portage namespace, inserting it into the +loaded modules list. +It also issues a warning to the caller to migrate to the new namespace. +Note that this module should never be used with it's true name, but only by +links pointing to it. Also it is limited to portage_foo -> portage.foo +translations, however existing subpackages shouldn't use it anyway to maintain +compability with 3rd party modules (like elog or cache plugins), and they +shouldn't be directly imported by external consumers. + +This module is based on an idea by Brian Harring. +""" + +import sys, warnings + +__oldname = __name__ +if __name__.startswith("portage_"): + __newname = __name__.replace("_", ".") +else: + __newname = "portage."+__name__ + +try: + __package = __import__(__newname, globals(), locals()) + __realmodule = getattr(__package, __newname[8:]) +except ImportError, AttributeError: + raise ImportError("No module named %s" % __oldname) + +warnings.warn("DEPRECATION NOTICE: The %s module was replaced by %s" % (__oldname, __newname)) +sys.modules[__oldname] = __realmodule diff --git a/pym/eclass_cache.py b/pym/eclass_cache.py new file mode 100644 index 000000000..ee2b71285 --- /dev/null +++ b/pym/eclass_cache.py @@ -0,0 +1,35 @@ +# portage_compat_namespace.py -- provide compability layer with new namespace +# Copyright 2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id: portage_compat_namespace.py 5981 2007-02-17 13:11:28Z genone $ + +""" +This module checks the name under which it is imported and attempts to load +the corresponding module of the new portage namespace, inserting it into the +loaded modules list. +It also issues a warning to the caller to migrate to the new namespace. +Note that this module should never be used with it's true name, but only by +links pointing to it. Also it is limited to portage_foo -> portage.foo +translations, however existing subpackages shouldn't use it anyway to maintain +compability with 3rd party modules (like elog or cache plugins), and they +shouldn't be directly imported by external consumers. + +This module is based on an idea by Brian Harring. +""" + +import sys, warnings + +__oldname = __name__ +if __name__.startswith("portage_"): + __newname = __name__.replace("_", ".") +else: + __newname = "portage."+__name__ + +try: + __package = __import__(__newname, globals(), locals()) + __realmodule = getattr(__package, __newname[8:]) +except ImportError, AttributeError: + raise ImportError("No module named %s" % __oldname) + +warnings.warn("DEPRECATION NOTICE: The %s module was replaced by %s" % (__oldname, __newname)) +sys.modules[__oldname] = __realmodule diff --git a/pym/emergehelp.py b/pym/emergehelp.py new file mode 100644 index 000000000..ee2b71285 --- /dev/null +++ b/pym/emergehelp.py @@ -0,0 +1,35 @@ +# portage_compat_namespace.py -- provide compability layer with new namespace +# Copyright 2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id: portage_compat_namespace.py 5981 2007-02-17 13:11:28Z genone $ + +""" +This module checks the name under which it is imported and attempts to load +the corresponding module of the new portage namespace, inserting it into the +loaded modules list. +It also issues a warning to the caller to migrate to the new namespace. +Note that this module should never be used with it's true name, but only by +links pointing to it. Also it is limited to portage_foo -> portage.foo +translations, however existing subpackages shouldn't use it anyway to maintain +compability with 3rd party modules (like elog or cache plugins), and they +shouldn't be directly imported by external consumers. + +This module is based on an idea by Brian Harring. +""" + +import sys, warnings + +__oldname = __name__ +if __name__.startswith("portage_"): + __newname = __name__.replace("_", ".") +else: + __newname = "portage."+__name__ + +try: + __package = __import__(__newname, globals(), locals()) + __realmodule = getattr(__package, __newname[8:]) +except ImportError, AttributeError: + raise ImportError("No module named %s" % __oldname) + +warnings.warn("DEPRECATION NOTICE: The %s module was replaced by %s" % (__oldname, __newname)) +sys.modules[__oldname] = __realmodule diff --git a/pym/getbinpkg.py b/pym/getbinpkg.py new file mode 100644 index 000000000..ee2b71285 --- /dev/null +++ b/pym/getbinpkg.py @@ -0,0 +1,35 @@ +# portage_compat_namespace.py -- provide compability layer with new namespace +# Copyright 2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id: portage_compat_namespace.py 5981 2007-02-17 13:11:28Z genone $ + +""" +This module checks the name under which it is imported and attempts to load +the corresponding module of the new portage namespace, inserting it into the +loaded modules list. +It also issues a warning to the caller to migrate to the new namespace. +Note that this module should never be used with it's true name, but only by +links pointing to it. Also it is limited to portage_foo -> portage.foo +translations, however existing subpackages shouldn't use it anyway to maintain +compability with 3rd party modules (like elog or cache plugins), and they +shouldn't be directly imported by external consumers. + +This module is based on an idea by Brian Harring. +""" + +import sys, warnings + +__oldname = __name__ +if __name__.startswith("portage_"): + __newname = __name__.replace("_", ".") +else: + __newname = "portage."+__name__ + +try: + __package = __import__(__newname, globals(), locals()) + __realmodule = getattr(__package, __newname[8:]) +except ImportError, AttributeError: + raise ImportError("No module named %s" % __oldname) + +warnings.warn("DEPRECATION NOTICE: The %s module was replaced by %s" % (__oldname, __newname)) +sys.modules[__oldname] = __realmodule diff --git a/pym/output.py b/pym/output.py new file mode 100644 index 000000000..ee2b71285 --- /dev/null +++ b/pym/output.py @@ -0,0 +1,35 @@ +# portage_compat_namespace.py -- provide compability layer with new namespace +# Copyright 2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id: portage_compat_namespace.py 5981 2007-02-17 13:11:28Z genone $ + +""" +This module checks the name under which it is imported and attempts to load +the corresponding module of the new portage namespace, inserting it into the +loaded modules list. +It also issues a warning to the caller to migrate to the new namespace. +Note that this module should never be used with it's true name, but only by +links pointing to it. Also it is limited to portage_foo -> portage.foo +translations, however existing subpackages shouldn't use it anyway to maintain +compability with 3rd party modules (like elog or cache plugins), and they +shouldn't be directly imported by external consumers. + +This module is based on an idea by Brian Harring. +""" + +import sys, warnings + +__oldname = __name__ +if __name__.startswith("portage_"): + __newname = __name__.replace("_", ".") +else: + __newname = "portage."+__name__ + +try: + __package = __import__(__newname, globals(), locals()) + __realmodule = getattr(__package, __newname[8:]) +except ImportError, AttributeError: + raise ImportError("No module named %s" % __oldname) + +warnings.warn("DEPRECATION NOTICE: The %s module was replaced by %s" % (__oldname, __newname)) +sys.modules[__oldname] = __realmodule diff --git a/pym/portage_checksum.py b/pym/portage_checksum.py new file mode 100644 index 000000000..ee2b71285 --- /dev/null +++ b/pym/portage_checksum.py @@ -0,0 +1,35 @@ +# portage_compat_namespace.py -- provide compability layer with new namespace +# Copyright 2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id: portage_compat_namespace.py 5981 2007-02-17 13:11:28Z genone $ + +""" +This module checks the name under which it is imported and attempts to load +the corresponding module of the new portage namespace, inserting it into the +loaded modules list. +It also issues a warning to the caller to migrate to the new namespace. +Note that this module should never be used with it's true name, but only by +links pointing to it. Also it is limited to portage_foo -> portage.foo +translations, however existing subpackages shouldn't use it anyway to maintain +compability with 3rd party modules (like elog or cache plugins), and they +shouldn't be directly imported by external consumers. + +This module is based on an idea by Brian Harring. +""" + +import sys, warnings + +__oldname = __name__ +if __name__.startswith("portage_"): + __newname = __name__.replace("_", ".") +else: + __newname = "portage."+__name__ + +try: + __package = __import__(__newname, globals(), locals()) + __realmodule = getattr(__package, __newname[8:]) +except ImportError, AttributeError: + raise ImportError("No module named %s" % __oldname) + +warnings.warn("DEPRECATION NOTICE: The %s module was replaced by %s" % (__oldname, __newname)) +sys.modules[__oldname] = __realmodule diff --git a/pym/portage_compat_namespace.py b/pym/portage_compat_namespace.py new file mode 100644 index 000000000..9e5e691a9 --- /dev/null +++ b/pym/portage_compat_namespace.py @@ -0,0 +1,35 @@ +# portage_compat_namespace.py -- provide compability layer with new namespace +# Copyright 2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +""" +This module checks the name under which it is imported and attempts to load +the corresponding module of the new portage namespace, inserting it into the +loaded modules list. +It also issues a warning to the caller to migrate to the new namespace. +Note that this module should never be used with it's true name, but only by +links pointing to it. Also it is limited to portage_foo -> portage.foo +translations, however existing subpackages shouldn't use it anyway to maintain +compability with 3rd party modules (like elog or cache plugins), and they +shouldn't be directly imported by external consumers. + +This module is based on an idea by Brian Harring. +""" + +import sys, warnings + +__oldname = __name__ +if __name__.startswith("portage_"): + __newname = __name__.replace("_", ".") +else: + __newname = "portage."+__name__ + +try: + __package = __import__(__newname, globals(), locals()) + __realmodule = getattr(__package, __newname[8:]) +except ImportError, AttributeError: + raise ImportError("No module named %s" % __oldname) + +warnings.warn("DEPRECATION NOTICE: The %s module was replaced by %s" % (__oldname, __newname)) +sys.modules[__oldname] = __realmodule diff --git a/pym/portage_const.py b/pym/portage_const.py new file mode 100644 index 000000000..ee2b71285 --- /dev/null +++ b/pym/portage_const.py @@ -0,0 +1,35 @@ +# portage_compat_namespace.py -- provide compability layer with new namespace +# Copyright 2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id: portage_compat_namespace.py 5981 2007-02-17 13:11:28Z genone $ + +""" +This module checks the name under which it is imported and attempts to load +the corresponding module of the new portage namespace, inserting it into the +loaded modules list. +It also issues a warning to the caller to migrate to the new namespace. +Note that this module should never be used with it's true name, but only by +links pointing to it. Also it is limited to portage_foo -> portage.foo +translations, however existing subpackages shouldn't use it anyway to maintain +compability with 3rd party modules (like elog or cache plugins), and they +shouldn't be directly imported by external consumers. + +This module is based on an idea by Brian Harring. +""" + +import sys, warnings + +__oldname = __name__ +if __name__.startswith("portage_"): + __newname = __name__.replace("_", ".") +else: + __newname = "portage."+__name__ + +try: + __package = __import__(__newname, globals(), locals()) + __realmodule = getattr(__package, __newname[8:]) +except ImportError, AttributeError: + raise ImportError("No module named %s" % __oldname) + +warnings.warn("DEPRECATION NOTICE: The %s module was replaced by %s" % (__oldname, __newname)) +sys.modules[__oldname] = __realmodule diff --git a/pym/portage_data.py b/pym/portage_data.py new file mode 100644 index 000000000..ee2b71285 --- /dev/null +++ b/pym/portage_data.py @@ -0,0 +1,35 @@ +# portage_compat_namespace.py -- provide compability layer with new namespace +# Copyright 2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id: portage_compat_namespace.py 5981 2007-02-17 13:11:28Z genone $ + +""" +This module checks the name under which it is imported and attempts to load +the corresponding module of the new portage namespace, inserting it into the +loaded modules list. +It also issues a warning to the caller to migrate to the new namespace. +Note that this module should never be used with it's true name, but only by +links pointing to it. Also it is limited to portage_foo -> portage.foo +translations, however existing subpackages shouldn't use it anyway to maintain +compability with 3rd party modules (like elog or cache plugins), and they +shouldn't be directly imported by external consumers. + +This module is based on an idea by Brian Harring. +""" + +import sys, warnings + +__oldname = __name__ +if __name__.startswith("portage_"): + __newname = __name__.replace("_", ".") +else: + __newname = "portage."+__name__ + +try: + __package = __import__(__newname, globals(), locals()) + __realmodule = getattr(__package, __newname[8:]) +except ImportError, AttributeError: + raise ImportError("No module named %s" % __oldname) + +warnings.warn("DEPRECATION NOTICE: The %s module was replaced by %s" % (__oldname, __newname)) +sys.modules[__oldname] = __realmodule diff --git a/pym/portage_debug.py b/pym/portage_debug.py new file mode 100644 index 000000000..ee2b71285 --- /dev/null +++ b/pym/portage_debug.py @@ -0,0 +1,35 @@ +# portage_compat_namespace.py -- provide compability layer with new namespace +# Copyright 2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id: portage_compat_namespace.py 5981 2007-02-17 13:11:28Z genone $ + +""" +This module checks the name under which it is imported and attempts to load +the corresponding module of the new portage namespace, inserting it into the +loaded modules list. +It also issues a warning to the caller to migrate to the new namespace. +Note that this module should never be used with it's true name, but only by +links pointing to it. Also it is limited to portage_foo -> portage.foo +translations, however existing subpackages shouldn't use it anyway to maintain +compability with 3rd party modules (like elog or cache plugins), and they +shouldn't be directly imported by external consumers. + +This module is based on an idea by Brian Harring. +""" + +import sys, warnings + +__oldname = __name__ +if __name__.startswith("portage_"): + __newname = __name__.replace("_", ".") +else: + __newname = "portage."+__name__ + +try: + __package = __import__(__newname, globals(), locals()) + __realmodule = getattr(__package, __newname[8:]) +except ImportError, AttributeError: + raise ImportError("No module named %s" % __oldname) + +warnings.warn("DEPRECATION NOTICE: The %s module was replaced by %s" % (__oldname, __newname)) +sys.modules[__oldname] = __realmodule diff --git a/pym/portage_dep.py b/pym/portage_dep.py new file mode 100644 index 000000000..ee2b71285 --- /dev/null +++ b/pym/portage_dep.py @@ -0,0 +1,35 @@ +# portage_compat_namespace.py -- provide compability layer with new namespace +# Copyright 2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id: portage_compat_namespace.py 5981 2007-02-17 13:11:28Z genone $ + +""" +This module checks the name under which it is imported and attempts to load +the corresponding module of the new portage namespace, inserting it into the +loaded modules list. +It also issues a warning to the caller to migrate to the new namespace. +Note that this module should never be used with it's true name, but only by +links pointing to it. Also it is limited to portage_foo -> portage.foo +translations, however existing subpackages shouldn't use it anyway to maintain +compability with 3rd party modules (like elog or cache plugins), and they +shouldn't be directly imported by external consumers. + +This module is based on an idea by Brian Harring. +""" + +import sys, warnings + +__oldname = __name__ +if __name__.startswith("portage_"): + __newname = __name__.replace("_", ".") +else: + __newname = "portage."+__name__ + +try: + __package = __import__(__newname, globals(), locals()) + __realmodule = getattr(__package, __newname[8:]) +except ImportError, AttributeError: + raise ImportError("No module named %s" % __oldname) + +warnings.warn("DEPRECATION NOTICE: The %s module was replaced by %s" % (__oldname, __newname)) +sys.modules[__oldname] = __realmodule diff --git a/pym/portage_exception.py b/pym/portage_exception.py new file mode 100644 index 000000000..ee2b71285 --- /dev/null +++ b/pym/portage_exception.py @@ -0,0 +1,35 @@ +# portage_compat_namespace.py -- provide compability layer with new namespace +# Copyright 2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id: portage_compat_namespace.py 5981 2007-02-17 13:11:28Z genone $ + +""" +This module checks the name under which it is imported and attempts to load +the corresponding module of the new portage namespace, inserting it into the +loaded modules list. +It also issues a warning to the caller to migrate to the new namespace. +Note that this module should never be used with it's true name, but only by +links pointing to it. Also it is limited to portage_foo -> portage.foo +translations, however existing subpackages shouldn't use it anyway to maintain +compability with 3rd party modules (like elog or cache plugins), and they +shouldn't be directly imported by external consumers. + +This module is based on an idea by Brian Harring. +""" + +import sys, warnings + +__oldname = __name__ +if __name__.startswith("portage_"): + __newname = __name__.replace("_", ".") +else: + __newname = "portage."+__name__ + +try: + __package = __import__(__newname, globals(), locals()) + __realmodule = getattr(__package, __newname[8:]) +except ImportError, AttributeError: + raise ImportError("No module named %s" % __oldname) + +warnings.warn("DEPRECATION NOTICE: The %s module was replaced by %s" % (__oldname, __newname)) +sys.modules[__oldname] = __realmodule diff --git a/pym/portage_exec.py b/pym/portage_exec.py new file mode 100644 index 000000000..30b5cdfd8 --- /dev/null +++ b/pym/portage_exec.py @@ -0,0 +1,15 @@ +# portage_compat_namespace.py -- provide compability layer with new namespace +# Copyright 2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id: portage_compat_namespace.py 5782 2007-01-25 17:07:32Z genone $ + +""" +Special edition of portage_compat_namespace.py as for this module we can't translate +name automatically as "import portage.exec" is a SyntaxError. +""" + +import sys, warnings + +import portage.process +warnings.warn("DEPRECATION NOTICE: The portage_exec module was replaced by portage.process") +sys.modules["portage_exec"] = portage.process diff --git a/pym/portage_gpg.py b/pym/portage_gpg.py new file mode 100644 index 000000000..ee2b71285 --- /dev/null +++ b/pym/portage_gpg.py @@ -0,0 +1,35 @@ +# portage_compat_namespace.py -- provide compability layer with new namespace +# Copyright 2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id: portage_compat_namespace.py 5981 2007-02-17 13:11:28Z genone $ + +""" +This module checks the name under which it is imported and attempts to load +the corresponding module of the new portage namespace, inserting it into the +loaded modules list. +It also issues a warning to the caller to migrate to the new namespace. +Note that this module should never be used with it's true name, but only by +links pointing to it. Also it is limited to portage_foo -> portage.foo +translations, however existing subpackages shouldn't use it anyway to maintain +compability with 3rd party modules (like elog or cache plugins), and they +shouldn't be directly imported by external consumers. + +This module is based on an idea by Brian Harring. +""" + +import sys, warnings + +__oldname = __name__ +if __name__.startswith("portage_"): + __newname = __name__.replace("_", ".") +else: + __newname = "portage."+__name__ + +try: + __package = __import__(__newname, globals(), locals()) + __realmodule = getattr(__package, __newname[8:]) +except ImportError, AttributeError: + raise ImportError("No module named %s" % __oldname) + +warnings.warn("DEPRECATION NOTICE: The %s module was replaced by %s" % (__oldname, __newname)) +sys.modules[__oldname] = __realmodule diff --git a/pym/portage_localization.py b/pym/portage_localization.py new file mode 100644 index 000000000..ee2b71285 --- /dev/null +++ b/pym/portage_localization.py @@ -0,0 +1,35 @@ +# portage_compat_namespace.py -- provide compability layer with new namespace +# Copyright 2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id: portage_compat_namespace.py 5981 2007-02-17 13:11:28Z genone $ + +""" +This module checks the name under which it is imported and attempts to load +the corresponding module of the new portage namespace, inserting it into the +loaded modules list. +It also issues a warning to the caller to migrate to the new namespace. +Note that this module should never be used with it's true name, but only by +links pointing to it. Also it is limited to portage_foo -> portage.foo +translations, however existing subpackages shouldn't use it anyway to maintain +compability with 3rd party modules (like elog or cache plugins), and they +shouldn't be directly imported by external consumers. + +This module is based on an idea by Brian Harring. +""" + +import sys, warnings + +__oldname = __name__ +if __name__.startswith("portage_"): + __newname = __name__.replace("_", ".") +else: + __newname = "portage."+__name__ + +try: + __package = __import__(__newname, globals(), locals()) + __realmodule = getattr(__package, __newname[8:]) +except ImportError, AttributeError: + raise ImportError("No module named %s" % __oldname) + +warnings.warn("DEPRECATION NOTICE: The %s module was replaced by %s" % (__oldname, __newname)) +sys.modules[__oldname] = __realmodule diff --git a/pym/portage_locks.py b/pym/portage_locks.py new file mode 100644 index 000000000..ee2b71285 --- /dev/null +++ b/pym/portage_locks.py @@ -0,0 +1,35 @@ +# portage_compat_namespace.py -- provide compability layer with new namespace +# Copyright 2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id: portage_compat_namespace.py 5981 2007-02-17 13:11:28Z genone $ + +""" +This module checks the name under which it is imported and attempts to load +the corresponding module of the new portage namespace, inserting it into the +loaded modules list. +It also issues a warning to the caller to migrate to the new namespace. +Note that this module should never be used with it's true name, but only by +links pointing to it. Also it is limited to portage_foo -> portage.foo +translations, however existing subpackages shouldn't use it anyway to maintain +compability with 3rd party modules (like elog or cache plugins), and they +shouldn't be directly imported by external consumers. + +This module is based on an idea by Brian Harring. +""" + +import sys, warnings + +__oldname = __name__ +if __name__.startswith("portage_"): + __newname = __name__.replace("_", ".") +else: + __newname = "portage."+__name__ + +try: + __package = __import__(__newname, globals(), locals()) + __realmodule = getattr(__package, __newname[8:]) +except ImportError, AttributeError: + raise ImportError("No module named %s" % __oldname) + +warnings.warn("DEPRECATION NOTICE: The %s module was replaced by %s" % (__oldname, __newname)) +sys.modules[__oldname] = __realmodule diff --git a/pym/portage_mail.py b/pym/portage_mail.py new file mode 100644 index 000000000..ee2b71285 --- /dev/null +++ b/pym/portage_mail.py @@ -0,0 +1,35 @@ +# portage_compat_namespace.py -- provide compability layer with new namespace +# Copyright 2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id: portage_compat_namespace.py 5981 2007-02-17 13:11:28Z genone $ + +""" +This module checks the name under which it is imported and attempts to load +the corresponding module of the new portage namespace, inserting it into the +loaded modules list. +It also issues a warning to the caller to migrate to the new namespace. +Note that this module should never be used with it's true name, but only by +links pointing to it. Also it is limited to portage_foo -> portage.foo +translations, however existing subpackages shouldn't use it anyway to maintain +compability with 3rd party modules (like elog or cache plugins), and they +shouldn't be directly imported by external consumers. + +This module is based on an idea by Brian Harring. +""" + +import sys, warnings + +__oldname = __name__ +if __name__.startswith("portage_"): + __newname = __name__.replace("_", ".") +else: + __newname = "portage."+__name__ + +try: + __package = __import__(__newname, globals(), locals()) + __realmodule = getattr(__package, __newname[8:]) +except ImportError, AttributeError: + raise ImportError("No module named %s" % __oldname) + +warnings.warn("DEPRECATION NOTICE: The %s module was replaced by %s" % (__oldname, __newname)) +sys.modules[__oldname] = __realmodule diff --git a/pym/portage_manifest.py b/pym/portage_manifest.py new file mode 100644 index 000000000..ee2b71285 --- /dev/null +++ b/pym/portage_manifest.py @@ -0,0 +1,35 @@ +# portage_compat_namespace.py -- provide compability layer with new namespace +# Copyright 2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id: portage_compat_namespace.py 5981 2007-02-17 13:11:28Z genone $ + +""" +This module checks the name under which it is imported and attempts to load +the corresponding module of the new portage namespace, inserting it into the +loaded modules list. +It also issues a warning to the caller to migrate to the new namespace. +Note that this module should never be used with it's true name, but only by +links pointing to it. Also it is limited to portage_foo -> portage.foo +translations, however existing subpackages shouldn't use it anyway to maintain +compability with 3rd party modules (like elog or cache plugins), and they +shouldn't be directly imported by external consumers. + +This module is based on an idea by Brian Harring. +""" + +import sys, warnings + +__oldname = __name__ +if __name__.startswith("portage_"): + __newname = __name__.replace("_", ".") +else: + __newname = "portage."+__name__ + +try: + __package = __import__(__newname, globals(), locals()) + __realmodule = getattr(__package, __newname[8:]) +except ImportError, AttributeError: + raise ImportError("No module named %s" % __oldname) + +warnings.warn("DEPRECATION NOTICE: The %s module was replaced by %s" % (__oldname, __newname)) +sys.modules[__oldname] = __realmodule diff --git a/pym/portage_news.py b/pym/portage_news.py new file mode 100644 index 000000000..ee2b71285 --- /dev/null +++ b/pym/portage_news.py @@ -0,0 +1,35 @@ +# portage_compat_namespace.py -- provide compability layer with new namespace +# Copyright 2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id: portage_compat_namespace.py 5981 2007-02-17 13:11:28Z genone $ + +""" +This module checks the name under which it is imported and attempts to load +the corresponding module of the new portage namespace, inserting it into the +loaded modules list. +It also issues a warning to the caller to migrate to the new namespace. +Note that this module should never be used with it's true name, but only by +links pointing to it. Also it is limited to portage_foo -> portage.foo +translations, however existing subpackages shouldn't use it anyway to maintain +compability with 3rd party modules (like elog or cache plugins), and they +shouldn't be directly imported by external consumers. + +This module is based on an idea by Brian Harring. +""" + +import sys, warnings + +__oldname = __name__ +if __name__.startswith("portage_"): + __newname = __name__.replace("_", ".") +else: + __newname = "portage."+__name__ + +try: + __package = __import__(__newname, globals(), locals()) + __realmodule = getattr(__package, __newname[8:]) +except ImportError, AttributeError: + raise ImportError("No module named %s" % __oldname) + +warnings.warn("DEPRECATION NOTICE: The %s module was replaced by %s" % (__oldname, __newname)) +sys.modules[__oldname] = __realmodule diff --git a/pym/portage_selinux.py b/pym/portage_selinux.py new file mode 100644 index 000000000..ee2b71285 --- /dev/null +++ b/pym/portage_selinux.py @@ -0,0 +1,35 @@ +# portage_compat_namespace.py -- provide compability layer with new namespace +# Copyright 2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id: portage_compat_namespace.py 5981 2007-02-17 13:11:28Z genone $ + +""" +This module checks the name under which it is imported and attempts to load +the corresponding module of the new portage namespace, inserting it into the +loaded modules list. +It also issues a warning to the caller to migrate to the new namespace. +Note that this module should never be used with it's true name, but only by +links pointing to it. Also it is limited to portage_foo -> portage.foo +translations, however existing subpackages shouldn't use it anyway to maintain +compability with 3rd party modules (like elog or cache plugins), and they +shouldn't be directly imported by external consumers. + +This module is based on an idea by Brian Harring. +""" + +import sys, warnings + +__oldname = __name__ +if __name__.startswith("portage_"): + __newname = __name__.replace("_", ".") +else: + __newname = "portage."+__name__ + +try: + __package = __import__(__newname, globals(), locals()) + __realmodule = getattr(__package, __newname[8:]) +except ImportError, AttributeError: + raise ImportError("No module named %s" % __oldname) + +warnings.warn("DEPRECATION NOTICE: The %s module was replaced by %s" % (__oldname, __newname)) +sys.modules[__oldname] = __realmodule diff --git a/pym/portage_update.py b/pym/portage_update.py new file mode 100644 index 000000000..ee2b71285 --- /dev/null +++ b/pym/portage_update.py @@ -0,0 +1,35 @@ +# portage_compat_namespace.py -- provide compability layer with new namespace +# Copyright 2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id: portage_compat_namespace.py 5981 2007-02-17 13:11:28Z genone $ + +""" +This module checks the name under which it is imported and attempts to load +the corresponding module of the new portage namespace, inserting it into the +loaded modules list. +It also issues a warning to the caller to migrate to the new namespace. +Note that this module should never be used with it's true name, but only by +links pointing to it. Also it is limited to portage_foo -> portage.foo +translations, however existing subpackages shouldn't use it anyway to maintain +compability with 3rd party modules (like elog or cache plugins), and they +shouldn't be directly imported by external consumers. + +This module is based on an idea by Brian Harring. +""" + +import sys, warnings + +__oldname = __name__ +if __name__.startswith("portage_"): + __newname = __name__.replace("_", ".") +else: + __newname = "portage."+__name__ + +try: + __package = __import__(__newname, globals(), locals()) + __realmodule = getattr(__package, __newname[8:]) +except ImportError, AttributeError: + raise ImportError("No module named %s" % __oldname) + +warnings.warn("DEPRECATION NOTICE: The %s module was replaced by %s" % (__oldname, __newname)) +sys.modules[__oldname] = __realmodule diff --git a/pym/portage_util.py b/pym/portage_util.py new file mode 100644 index 000000000..ee2b71285 --- /dev/null +++ b/pym/portage_util.py @@ -0,0 +1,35 @@ +# portage_compat_namespace.py -- provide compability layer with new namespace +# Copyright 2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id: portage_compat_namespace.py 5981 2007-02-17 13:11:28Z genone $ + +""" +This module checks the name under which it is imported and attempts to load +the corresponding module of the new portage namespace, inserting it into the +loaded modules list. +It also issues a warning to the caller to migrate to the new namespace. +Note that this module should never be used with it's true name, but only by +links pointing to it. Also it is limited to portage_foo -> portage.foo +translations, however existing subpackages shouldn't use it anyway to maintain +compability with 3rd party modules (like elog or cache plugins), and they +shouldn't be directly imported by external consumers. + +This module is based on an idea by Brian Harring. +""" + +import sys, warnings + +__oldname = __name__ +if __name__.startswith("portage_"): + __newname = __name__.replace("_", ".") +else: + __newname = "portage."+__name__ + +try: + __package = __import__(__newname, globals(), locals()) + __realmodule = getattr(__package, __newname[8:]) +except ImportError, AttributeError: + raise ImportError("No module named %s" % __oldname) + +warnings.warn("DEPRECATION NOTICE: The %s module was replaced by %s" % (__oldname, __newname)) +sys.modules[__oldname] = __realmodule diff --git a/pym/portage_versions.py b/pym/portage_versions.py new file mode 100644 index 000000000..ee2b71285 --- /dev/null +++ b/pym/portage_versions.py @@ -0,0 +1,35 @@ +# portage_compat_namespace.py -- provide compability layer with new namespace +# Copyright 2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id: portage_compat_namespace.py 5981 2007-02-17 13:11:28Z genone $ + +""" +This module checks the name under which it is imported and attempts to load +the corresponding module of the new portage namespace, inserting it into the +loaded modules list. +It also issues a warning to the caller to migrate to the new namespace. +Note that this module should never be used with it's true name, but only by +links pointing to it. Also it is limited to portage_foo -> portage.foo +translations, however existing subpackages shouldn't use it anyway to maintain +compability with 3rd party modules (like elog or cache plugins), and they +shouldn't be directly imported by external consumers. + +This module is based on an idea by Brian Harring. +""" + +import sys, warnings + +__oldname = __name__ +if __name__.startswith("portage_"): + __newname = __name__.replace("_", ".") +else: + __newname = "portage."+__name__ + +try: + __package = __import__(__newname, globals(), locals()) + __realmodule = getattr(__package, __newname[8:]) +except ImportError, AttributeError: + raise ImportError("No module named %s" % __oldname) + +warnings.warn("DEPRECATION NOTICE: The %s module was replaced by %s" % (__oldname, __newname)) +sys.modules[__oldname] = __realmodule diff --git a/pym/xpak.py b/pym/xpak.py new file mode 100644 index 000000000..ee2b71285 --- /dev/null +++ b/pym/xpak.py @@ -0,0 +1,35 @@ +# portage_compat_namespace.py -- provide compability layer with new namespace +# Copyright 2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id: portage_compat_namespace.py 5981 2007-02-17 13:11:28Z genone $ + +""" +This module checks the name under which it is imported and attempts to load +the corresponding module of the new portage namespace, inserting it into the +loaded modules list. +It also issues a warning to the caller to migrate to the new namespace. +Note that this module should never be used with it's true name, but only by +links pointing to it. Also it is limited to portage_foo -> portage.foo +translations, however existing subpackages shouldn't use it anyway to maintain +compability with 3rd party modules (like elog or cache plugins), and they +shouldn't be directly imported by external consumers. + +This module is based on an idea by Brian Harring. +""" + +import sys, warnings + +__oldname = __name__ +if __name__.startswith("portage_"): + __newname = __name__.replace("_", ".") +else: + __newname = "portage."+__name__ + +try: + __package = __import__(__newname, globals(), locals()) + __realmodule = getattr(__package, __newname[8:]) +except ImportError, AttributeError: + raise ImportError("No module named %s" % __oldname) + +warnings.warn("DEPRECATION NOTICE: The %s module was replaced by %s" % (__oldname, __newname)) +sys.modules[__oldname] = __realmodule -- 2.26.2