public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] portage r15692 - in main/branches/2.1.7/pym/portage: . package/ebuild
@ 2010-03-02 21:09 Zac Medico (zmedico)
  0 siblings, 0 replies; only message in thread
From: Zac Medico (zmedico) @ 2010-03-02 21:09 UTC (permalink / raw
  To: gentoo-commits

Author: zmedico
Date: 2010-03-02 21:09:01 +0000 (Tue, 02 Mar 2010)
New Revision: 15692

Added:
   main/branches/2.1.7/pym/portage/package/ebuild/deprecated_profile_check.py
Modified:
   main/branches/2.1.7/pym/portage/__init__.py
Log:
Move deprecated_profile_check to portage.package.ebuild submodule.
(trunk r15491)

Modified: main/branches/2.1.7/pym/portage/__init__.py
===================================================================
--- main/branches/2.1.7/pym/portage/__init__.py	2010-03-02 21:08:42 UTC (rev 15691)
+++ main/branches/2.1.7/pym/portage/__init__.py	2010-03-02 21:09:01 UTC (rev 15692)
@@ -107,6 +107,8 @@
 			'doebuild_environment,spawn,spawnebuild',
 		'portage.package.ebuild.config:autouse,best_from_dict,' + \
 			'check_config_instance,config',
+		'portage.package.ebuild.deprecated_profile_check:' + \
+			'deprecated_profile_check',
 		'portage.package.ebuild.digestcheck:digestcheck',
 		'portage.package.ebuild.digestgen:digestgen',
 		'portage.package.ebuild.fetch:fetch',
@@ -507,36 +509,6 @@
 )
 auxdbkeylen=len(auxdbkeys)
 
-def deprecated_profile_check(settings=None):
-	config_root = "/"
-	if settings is not None:
-		config_root = settings["PORTAGE_CONFIGROOT"]
-	deprecated_profile_file = os.path.join(config_root,
-		DEPRECATED_PROFILE_FILE)
-	if not os.access(deprecated_profile_file, os.R_OK):
-		return False
-	dcontent = codecs.open(_unicode_encode(deprecated_profile_file,
-		encoding=_encodings['fs'], errors='strict'), 
-		mode='r', encoding=_encodings['content'], errors='replace').readlines()
-	writemsg(colorize("BAD", _("\n!!! Your current profile is "
-		"deprecated and not supported anymore.")) + "\n", noiselevel=-1)
-	writemsg(colorize("BAD", _("!!! Use eselect profile to update your "
-		"profile.")) + "\n", noiselevel=-1)
-	if not dcontent:
-		writemsg(colorize("BAD", _("!!! Please refer to the "
-			"Gentoo Upgrading Guide.")) + "\n", noiselevel=-1)
-		return True
-	newprofile = dcontent[0]
-	writemsg(colorize("BAD", _("!!! Please upgrade to the "
-		"following profile if possible:")) + "\n", noiselevel=-1)
-	writemsg(8*" " + colorize("GOOD", newprofile) + "\n", noiselevel=-1)
-	if len(dcontent) > 1:
-		writemsg(_("To upgrade do the following steps:\n"), noiselevel=-1)
-		for myline in dcontent[1:]:
-			writemsg(myline, noiselevel=-1)
-		writemsg("\n\n", noiselevel=-1)
-	return True
-
 def portageexit():
 	if secpass > 1 and os.environ.get("SANDBOX_ON") != "1":
 		close_portdbapi_caches()

Copied: main/branches/2.1.7/pym/portage/package/ebuild/deprecated_profile_check.py (from rev 15491, main/trunk/pym/portage/package/ebuild/deprecated_profile_check.py)
===================================================================
--- main/branches/2.1.7/pym/portage/package/ebuild/deprecated_profile_check.py	                        (rev 0)
+++ main/branches/2.1.7/pym/portage/package/ebuild/deprecated_profile_check.py	2010-03-02 21:09:01 UTC (rev 15692)
@@ -0,0 +1,43 @@
+# Copyright 2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+__all__ = ['deprecated_profile_check']
+
+import codecs
+
+from portage import os, _encodings, _unicode_encode
+from portage.const import DEPRECATED_PROFILE_FILE
+from portage.localization import _
+from portage.output import colorize
+from portage.util import writemsg
+
+def deprecated_profile_check(settings=None):
+	config_root = "/"
+	if settings is not None:
+		config_root = settings["PORTAGE_CONFIGROOT"]
+	deprecated_profile_file = os.path.join(config_root,
+		DEPRECATED_PROFILE_FILE)
+	if not os.access(deprecated_profile_file, os.R_OK):
+		return False
+	dcontent = codecs.open(_unicode_encode(deprecated_profile_file,
+		encoding=_encodings['fs'], errors='strict'), 
+		mode='r', encoding=_encodings['content'], errors='replace').readlines()
+	writemsg(colorize("BAD", _("\n!!! Your current profile is "
+		"deprecated and not supported anymore.")) + "\n", noiselevel=-1)
+	writemsg(colorize("BAD", _("!!! Use eselect profile to update your "
+		"profile.")) + "\n", noiselevel=-1)
+	if not dcontent:
+		writemsg(colorize("BAD", _("!!! Please refer to the "
+			"Gentoo Upgrading Guide.")) + "\n", noiselevel=-1)
+		return True
+	newprofile = dcontent[0]
+	writemsg(colorize("BAD", _("!!! Please upgrade to the "
+		"following profile if possible:")) + "\n", noiselevel=-1)
+	writemsg(8*" " + colorize("GOOD", newprofile) + "\n", noiselevel=-1)
+	if len(dcontent) > 1:
+		writemsg(_("To upgrade do the following steps:\n"), noiselevel=-1)
+		for myline in dcontent[1:]:
+			writemsg(myline, noiselevel=-1)
+		writemsg("\n\n", noiselevel=-1)
+	return True




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

only message in thread, other threads:[~2010-03-02 21:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-02 21:09 [gentoo-commits] portage r15692 - in main/branches/2.1.7/pym/portage: . package/ebuild Zac Medico (zmedico)

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