1 |
Author: zmedico |
2 |
Date: 2010-02-28 04:28:21 +0000 (Sun, 28 Feb 2010) |
3 |
New Revision: 15491 |
4 |
|
5 |
Added: |
6 |
main/trunk/pym/portage/package/ebuild/deprecated_profile_check.py |
7 |
Modified: |
8 |
main/trunk/pym/portage/__init__.py |
9 |
Log: |
10 |
Move deprecated_profile_check to portage.package.ebuild submodule. |
11 |
|
12 |
|
13 |
Modified: main/trunk/pym/portage/__init__.py |
14 |
=================================================================== |
15 |
--- main/trunk/pym/portage/__init__.py 2010-02-28 04:09:59 UTC (rev 15490) |
16 |
+++ main/trunk/pym/portage/__init__.py 2010-02-28 04:28:21 UTC (rev 15491) |
17 |
@@ -107,6 +107,8 @@ |
18 |
'doebuild_environment,spawn,spawnebuild', |
19 |
'portage.package.ebuild.config:autouse,best_from_dict,' + \ |
20 |
'check_config_instance,config', |
21 |
+ 'portage.package.ebuild.deprecated_profile_check:' + \ |
22 |
+ 'deprecated_profile_check', |
23 |
'portage.package.ebuild.digestcheck:digestcheck', |
24 |
'portage.package.ebuild.digestgen:digestgen', |
25 |
'portage.package.ebuild.fetch:fetch', |
26 |
@@ -507,36 +509,6 @@ |
27 |
) |
28 |
auxdbkeylen=len(auxdbkeys) |
29 |
|
30 |
-def deprecated_profile_check(settings=None): |
31 |
- config_root = "/" |
32 |
- if settings is not None: |
33 |
- config_root = settings["PORTAGE_CONFIGROOT"] |
34 |
- deprecated_profile_file = os.path.join(config_root, |
35 |
- DEPRECATED_PROFILE_FILE) |
36 |
- if not os.access(deprecated_profile_file, os.R_OK): |
37 |
- return False |
38 |
- dcontent = codecs.open(_unicode_encode(deprecated_profile_file, |
39 |
- encoding=_encodings['fs'], errors='strict'), |
40 |
- mode='r', encoding=_encodings['content'], errors='replace').readlines() |
41 |
- writemsg(colorize("BAD", _("\n!!! Your current profile is " |
42 |
- "deprecated and not supported anymore.")) + "\n", noiselevel=-1) |
43 |
- writemsg(colorize("BAD", _("!!! Use eselect profile to update your " |
44 |
- "profile.")) + "\n", noiselevel=-1) |
45 |
- if not dcontent: |
46 |
- writemsg(colorize("BAD", _("!!! Please refer to the " |
47 |
- "Gentoo Upgrading Guide.")) + "\n", noiselevel=-1) |
48 |
- return True |
49 |
- newprofile = dcontent[0] |
50 |
- writemsg(colorize("BAD", _("!!! Please upgrade to the " |
51 |
- "following profile if possible:")) + "\n", noiselevel=-1) |
52 |
- writemsg(8*" " + colorize("GOOD", newprofile) + "\n", noiselevel=-1) |
53 |
- if len(dcontent) > 1: |
54 |
- writemsg(_("To upgrade do the following steps:\n"), noiselevel=-1) |
55 |
- for myline in dcontent[1:]: |
56 |
- writemsg(myline, noiselevel=-1) |
57 |
- writemsg("\n\n", noiselevel=-1) |
58 |
- return True |
59 |
- |
60 |
def portageexit(): |
61 |
if secpass > 1 and os.environ.get("SANDBOX_ON") != "1": |
62 |
close_portdbapi_caches() |
63 |
|
64 |
Added: main/trunk/pym/portage/package/ebuild/deprecated_profile_check.py |
65 |
=================================================================== |
66 |
--- main/trunk/pym/portage/package/ebuild/deprecated_profile_check.py (rev 0) |
67 |
+++ main/trunk/pym/portage/package/ebuild/deprecated_profile_check.py 2010-02-28 04:28:21 UTC (rev 15491) |
68 |
@@ -0,0 +1,43 @@ |
69 |
+# Copyright 2010 Gentoo Foundation |
70 |
+# Distributed under the terms of the GNU General Public License v2 |
71 |
+# $Id$ |
72 |
+ |
73 |
+__all__ = ['deprecated_profile_check'] |
74 |
+ |
75 |
+import codecs |
76 |
+ |
77 |
+from portage import os, _encodings, _unicode_encode |
78 |
+from portage.const import DEPRECATED_PROFILE_FILE |
79 |
+from portage.localization import _ |
80 |
+from portage.output import colorize |
81 |
+from portage.util import writemsg |
82 |
+ |
83 |
+def deprecated_profile_check(settings=None): |
84 |
+ config_root = "/" |
85 |
+ if settings is not None: |
86 |
+ config_root = settings["PORTAGE_CONFIGROOT"] |
87 |
+ deprecated_profile_file = os.path.join(config_root, |
88 |
+ DEPRECATED_PROFILE_FILE) |
89 |
+ if not os.access(deprecated_profile_file, os.R_OK): |
90 |
+ return False |
91 |
+ dcontent = codecs.open(_unicode_encode(deprecated_profile_file, |
92 |
+ encoding=_encodings['fs'], errors='strict'), |
93 |
+ mode='r', encoding=_encodings['content'], errors='replace').readlines() |
94 |
+ writemsg(colorize("BAD", _("\n!!! Your current profile is " |
95 |
+ "deprecated and not supported anymore.")) + "\n", noiselevel=-1) |
96 |
+ writemsg(colorize("BAD", _("!!! Use eselect profile to update your " |
97 |
+ "profile.")) + "\n", noiselevel=-1) |
98 |
+ if not dcontent: |
99 |
+ writemsg(colorize("BAD", _("!!! Please refer to the " |
100 |
+ "Gentoo Upgrading Guide.")) + "\n", noiselevel=-1) |
101 |
+ return True |
102 |
+ newprofile = dcontent[0] |
103 |
+ writemsg(colorize("BAD", _("!!! Please upgrade to the " |
104 |
+ "following profile if possible:")) + "\n", noiselevel=-1) |
105 |
+ writemsg(8*" " + colorize("GOOD", newprofile) + "\n", noiselevel=-1) |
106 |
+ if len(dcontent) > 1: |
107 |
+ writemsg(_("To upgrade do the following steps:\n"), noiselevel=-1) |
108 |
+ for myline in dcontent[1:]: |
109 |
+ writemsg(myline, noiselevel=-1) |
110 |
+ writemsg("\n\n", noiselevel=-1) |
111 |
+ return True |
112 |
|
113 |
|
114 |
Property changes on: main/trunk/pym/portage/package/ebuild/deprecated_profile_check.py |
115 |
___________________________________________________________________ |
116 |
Added: svn:keywords |
117 |
+ Id |