Merged from trunk 2980:5981
authorFabian Groffen <grobian@gentoo.org>
Mon, 26 Feb 2007 21:16:35 +0000 (21:16 -0000)
committerFabian Groffen <grobian@gentoo.org>
Mon, 26 Feb 2007 21:16:35 +0000 (21:16 -0000)
(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

24 files changed:
pym/cvstree.py [new file with mode: 0644]
pym/eclass_cache.py [new file with mode: 0644]
pym/emergehelp.py [new file with mode: 0644]
pym/getbinpkg.py [new file with mode: 0644]
pym/output.py [new file with mode: 0644]
pym/portage_checksum.py [new file with mode: 0644]
pym/portage_compat_namespace.py [new file with mode: 0644]
pym/portage_const.py [new file with mode: 0644]
pym/portage_data.py [new file with mode: 0644]
pym/portage_debug.py [new file with mode: 0644]
pym/portage_dep.py [new file with mode: 0644]
pym/portage_exception.py [new file with mode: 0644]
pym/portage_exec.py [new file with mode: 0644]
pym/portage_gpg.py [new file with mode: 0644]
pym/portage_localization.py [new file with mode: 0644]
pym/portage_locks.py [new file with mode: 0644]
pym/portage_mail.py [new file with mode: 0644]
pym/portage_manifest.py [new file with mode: 0644]
pym/portage_news.py [new file with mode: 0644]
pym/portage_selinux.py [new file with mode: 0644]
pym/portage_update.py [new file with mode: 0644]
pym/portage_util.py [new file with mode: 0644]
pym/portage_versions.py [new file with mode: 0644]
pym/xpak.py [new file with mode: 0644]

diff --git a/pym/cvstree.py b/pym/cvstree.py
new file mode 100644 (file)
index 0000000..ee2b712
--- /dev/null
@@ -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 (file)
index 0000000..ee2b712
--- /dev/null
@@ -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 (file)
index 0000000..ee2b712
--- /dev/null
@@ -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 (file)
index 0000000..ee2b712
--- /dev/null
@@ -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 (file)
index 0000000..ee2b712
--- /dev/null
@@ -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 (file)
index 0000000..ee2b712
--- /dev/null
@@ -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 (file)
index 0000000..9e5e691
--- /dev/null
@@ -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 (file)
index 0000000..ee2b712
--- /dev/null
@@ -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 (file)
index 0000000..ee2b712
--- /dev/null
@@ -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 (file)
index 0000000..ee2b712
--- /dev/null
@@ -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 (file)
index 0000000..ee2b712
--- /dev/null
@@ -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 (file)
index 0000000..ee2b712
--- /dev/null
@@ -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 (file)
index 0000000..30b5cdf
--- /dev/null
@@ -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 (file)
index 0000000..ee2b712
--- /dev/null
@@ -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 (file)
index 0000000..ee2b712
--- /dev/null
@@ -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 (file)
index 0000000..ee2b712
--- /dev/null
@@ -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 (file)
index 0000000..ee2b712
--- /dev/null
@@ -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 (file)
index 0000000..ee2b712
--- /dev/null
@@ -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 (file)
index 0000000..ee2b712
--- /dev/null
@@ -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 (file)
index 0000000..ee2b712
--- /dev/null
@@ -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 (file)
index 0000000..ee2b712
--- /dev/null
@@ -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 (file)
index 0000000..ee2b712
--- /dev/null
@@ -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 (file)
index 0000000..ee2b712
--- /dev/null
@@ -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 (file)
index 0000000..ee2b712
--- /dev/null
@@ -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