Gentoo Archives: gentoo-commits

From: "Fabian Groffen (grobian)" <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r12131 - in main/branches/prefix: bin man pym/_emerge pym/portage
Date: Mon, 01 Dec 2008 20:59:52
Message-Id: E1L7Frx-0006qQ-3V@stork.gentoo.org
1 Author: grobian
2 Date: 2008-12-01 20:59:48 +0000 (Mon, 01 Dec 2008)
3 New Revision: 12131
4
5 Modified:
6 main/branches/prefix/bin/emaint
7 main/branches/prefix/man/emerge.1
8 main/branches/prefix/man/portage.5
9 main/branches/prefix/pym/_emerge/__init__.py
10 main/branches/prefix/pym/_emerge/help.py
11 main/branches/prefix/pym/portage/__init__.py
12 Log:
13 Merged from trunk -r12057:12086
14
15 | 12059 | Document "I" which represents PROPERTIES=interactive in the |
16 | zmedico | merge list display. |
17
18 | 12061 | Use a table to organize the key of merge list display codes |
19 | zmedico | for the --pretend option. |
20
21 | 12063 | Use a table to organize the key of USE flag symbols for the |
22 | zmedico | --verbose option. |
23
24 | 12065 | Make emerge detect an invalid profile an bail out for |
25 | zmedico | anything except --help, --info, --sync, and --version |
26 | | actions. When bailing out, suggest to revert back to the |
27 | | previous profile configuration advise the user which actions |
28 | | are allowed with an invalid profile. |
29
30 | 12066 | Inside profile_check(), call validate_ebuild_environment() |
31 | zmedico | to generate some extra profile warnings when appropriate. |
32
33 | 12068 | Add support for parsing EAPI labels in contained in 'eapi' |
34 | zmedico | files in the profiles, and bail out if the profile contains |
35 | | an unsupported EAPI value in any one of it's directories. We |
36 | | don't necessarily have to use this but at least it gives us |
37 | | some way to make emerge bail out early if a profile contains |
38 | | unsupported EAPI features. |
39
40 | 12070 | Document the 'eapi' profile file. |
41 | zmedico | |
42
43 | 12072 | Fix typo in --help. |
44 | zmedico | |
45
46 | 12077 | Add one newline, to wrap the "Global Updates" key to less |
47 | zmedico | than 80 columns. |
48
49 | 12079 | Also add 2 spaces after newline, for alignment. |
50 | zmedico | |
51
52 | 12081 | Use tar options to make files owned in release tarballs |
53 | zmedico | owned by portage:portage instead of the current user. |
54
55 | 12086 | Remove world and system targets for emerge --help since it |
56 | zmedico | no longer works now that they are sets rather than actions. |
57
58
59 Modified: main/branches/prefix/bin/emaint
60 ===================================================================
61 --- main/branches/prefix/bin/emaint 2008-12-01 20:56:01 UTC (rev 12130)
62 +++ main/branches/prefix/bin/emaint 2008-12-01 20:59:48 UTC (rev 12131)
63 @@ -502,7 +502,7 @@
64 usage = "usage: emaint [options] COMMAND"
65
66 desc = "The emaint program provides an interface to system health " + \
67 - "checks and maintenance. See the emaint(1) man page for " + \
68 + "checks and maintenance. See the emaint(1) man page " + \
69 "for additional information about the following commands:"
70
71 usage += "\n\n"
72
73 Modified: main/branches/prefix/man/emerge.1
74 ===================================================================
75 --- main/branches/prefix/man/emerge.1 2008-12-01 20:56:01 UTC (rev 12130)
76 +++ main/branches/prefix/man/emerge.1 2008-12-01 20:59:48 UTC (rev 12131)
77 @@ -16,7 +16,7 @@
78 \fB\-\-search\fR \fIsomestring\fR
79 .TP
80 .BR emerge
81 -\fB\-\-help\fR [\fBsystem\fR | \fBworld\fR | \fB\-\-sync\fR]
82 +\fB\-\-help\fR [\fB\-\-sync\fR]
83 .SH "DESCRIPTION"
84 \fBemerge\fR is the definitive command\-line interface to the Portage
85 system. It is primarily used for installing packages, and \fBemerge\fR
86 @@ -394,24 +394,19 @@
87 have been installed if \fB\-\-pretend\fR weren't used. Using \fB\-\-pretend\fR
88 is strongly recommended before installing an unfamiliar package. In
89 the printout:
90 -.br
91 -
92 -.br
93 -\fIN\fR = new (not yet installed)
94 -.br
95 -\fIS\fR = new SLOT installation (side-by-side versions)
96 -.br
97 -\fIU\fR = updating (to another version)
98 -.br
99 -\fID\fR = downgrading (best version seems lower)
100 -.br
101 -\fIR\fR = replacing (remerging same version))
102 -.br
103 -\fIF\fR = fetch restricted (must be manually downloaded)
104 -.br
105 -\fIf\fR = fetch restricted (already downloaded)
106 -.br
107 -\fIB\fR = blocked by an already installed package
108 +
109 +.TS
110 +lI l.
111 +N new (not yet installed)
112 +S new SLOT installation (side-by-side versions)
113 +U updating (to another version)
114 +D downgrading (best version seems lower)
115 +R replacing (remerging same version))
116 +F fetch restricted (must be manually downloaded)
117 +f fetch restricted (already downloaded)
118 +I interactive (requires user input)
119 +B blocked by an already installed package
120 +.TE
121 .TP
122 .BR "\-\-quiet " (\fB\-q\fR)
123 Results may vary, but the general outcome is a reduced or condensed
124 @@ -452,16 +447,18 @@
125 out GNU info errors, if any, and to show the USE flags that will be used for
126 each package when pretending. The following symbols are affixed to USE flags
127 in order to indicate their status:
128 -.br
129
130 -.br
131 -\fI- prefix\fR = not enabled (either disabled or removed)
132 -.br
133 -\fI* suffix\fR = transition to or from the enabled state
134 -.br
135 -\fI% suffix\fR = newly added or removed
136 -.br
137 -\fI() circumfix\fR = forced, masked, or removed
138 +.TS
139 +l l l
140 +___
141 +l l l.
142 +Symbol Location Meaning
143 +
144 +- prefix not enabled (either disabled or removed)
145 +* suffix transition to or from the enabled state
146 +% suffix newly added or removed
147 +() circumfix forced, masked, or removed
148 +.TE
149 .TP
150 .BR "\-\-with\-bdeps < y | n >"
151 In dependency calculations, pull in build time dependencies
152
153 Modified: main/branches/prefix/man/portage.5
154 ===================================================================
155 --- main/branches/prefix/man/portage.5 2008-12-01 20:56:01 UTC (rev 12130)
156 +++ main/branches/prefix/man/portage.5 2008-12-01 20:59:48 UTC (rev 12131)
157 @@ -25,6 +25,7 @@
158 site\-specific overrides go in \fB/etc/portage/profile/\fR
159 .nf
160 deprecated
161 +eapi
162 make.defaults
163 packages
164 packages.build
165 @@ -150,6 +151,11 @@
166 # ln -s /usr/portage/profiles/default-linux/alpha/2005.0 /etc/make.profile
167 .fi
168 .TP
169 +.BR eapi
170 +The first line of this file specifies the \fBEAPI\fR to which files in the
171 +same directory conform. See \fBebuild\fR(5) for information about \fBEAPI\fR
172 +and related features.
173 +.TP
174 .BR make.defaults
175 The profile default settings for Portage. The general format is described
176 in \fBmake.conf\fR(5). The \fImake.defaults\fR for your profile defines a
177
178 Modified: main/branches/prefix/pym/_emerge/__init__.py
179 ===================================================================
180 --- main/branches/prefix/pym/_emerge/__init__.py 2008-12-01 20:56:01 UTC (rev 12130)
181 +++ main/branches/prefix/pym/_emerge/__init__.py 2008-12-01 20:59:48 UTC (rev 12131)
182 @@ -14015,6 +14015,25 @@
183 print "!!! The short ebuild name \"%s\" is ambiguous. Please specify" % arg
184 print "!!! one of the above fully-qualified ebuild names instead.\n"
185
186 +def profile_check(trees, myaction, myopts):
187 + if myaction in ("info", "sync"):
188 + return os.EX_OK
189 + elif "--version" in myopts or "--help" in myopts:
190 + return os.EX_OK
191 + for root, root_trees in trees.iteritems():
192 + if root_trees["root_config"].settings.profiles:
193 + continue
194 + # generate some profile related warning messages
195 + validate_ebuild_environment(trees)
196 + msg = "If you have just changed your profile configuration, you " + \
197 + "should revert back to the previous configuration. Due to " + \
198 + "your current profile being invalid, allowed actions are " + \
199 + "limited to --help, --info, --sync, and --version."
200 + writemsg_level("".join("!!! %s\n" % l for l in textwrap.wrap(msg, 70)),
201 + level=logging.ERROR, noiselevel=-1)
202 + return 1
203 + return os.EX_OK
204 +
205 def emerge_main():
206 global portage # NFC why this is necessary now - genone
207 portage._disable_legacy_globals()
208 @@ -14035,6 +14054,9 @@
209 os.umask(022)
210 settings, trees, mtimedb = load_emerge_config()
211 portdb = trees[settings["ROOT"]]["porttree"].dbapi
212 + rval = profile_check(trees, myaction, myopts)
213 + if rval != os.EX_OK:
214 + return rval
215
216 if portage._global_updates(trees, mtimedb["updates"]):
217 mtimedb.commit()
218
219 Modified: main/branches/prefix/pym/_emerge/help.py
220 ===================================================================
221 --- main/branches/prefix/pym/_emerge/help.py 2008-12-01 20:56:01 UTC (rev 12130)
222 +++ main/branches/prefix/pym/_emerge/help.py 2008-12-01 20:59:48 UTC (rev 12131)
223 @@ -463,32 +463,3 @@
224 print " exist on it, including ones that you may have created. The exceptions"
225 print " to this are the distfiles, local and packages directories."
226 print
227 - elif myaction=="system":
228 - print
229 - print bold("Usage: ")+turquoise("emerge")+" [ "+green("options")+" ] "+turquoise("system")
230 - print
231 - print " \"emerge system\" is the Portage system update command. When run, it"
232 - print " will scan the etc/make.profile/packages file and determine what"
233 - print " packages need to be installed so that your system meets the minimum"
234 - print " requirements of your current system profile. Note that this doesn't"
235 - print " necessarily bring your system up-to-date at all; instead, it just"
236 - print " ensures that you have no missing parts. For example, if your system"
237 - print " profile specifies that you should have sys-apps/iptables installed"
238 - print " and you don't, then \"emerge system\" will install it (the most"
239 - print " recent version that matches the profile spec) for you. It's always a"
240 - print " good idea to do an \"emerge --pretend system\" before an \"emerge"
241 - print " system\", just so you know what emerge is planning to do."
242 - print
243 - elif myaction=="world":
244 - print
245 - print bold("Usage: ")+turquoise("emerge")+" [ "+green("options")+" ] "+turquoise("world")
246 - print
247 - print " 'emerge world' is the Portage command for completely updating your"
248 - print " system. The normal procedure is to first do an 'emerge --sync' and"
249 - print " then an 'emerge --update --deep world'. The first command brings your"
250 - print " local Portage tree up-to-date with the latest version information and"
251 - print " ebuilds. The second command then rebuilds all packages for which newer"
252 - print " versions or newer ebuilds have become available since you last did a"
253 - print " sync and update."
254 - print
255 -
256
257 Modified: main/branches/prefix/pym/portage/__init__.py
258 ===================================================================
259 --- main/branches/prefix/pym/portage/__init__.py 2008-12-01 20:56:01 UTC (rev 12130)
260 +++ main/branches/prefix/pym/portage/__init__.py 2008-12-01 20:59:48 UTC (rev 12131)
261 @@ -1204,6 +1204,17 @@
262 self.profiles = []
263 def addProfile(currentPath):
264 parentsFile = os.path.join(currentPath, "parent")
265 + eapi_file = os.path.join(currentPath, "eapi")
266 + try:
267 + eapi = open(eapi_file).readline().strip()
268 + except IOError:
269 + pass
270 + else:
271 + if not eapi_is_supported(eapi):
272 + raise portage.exception.ParseError(
273 + "Profile contains unsupported " + \
274 + "EAPI '%s': '%s'" % \
275 + (eapi, os.path.realpath(eapi_file),))
276 if os.path.exists(parentsFile):
277 parents = grabfile(parentsFile)
278 if not parents:
279 @@ -1227,7 +1238,7 @@
280 writemsg("!!! ParseError: %s\n" % str(e), noiselevel=-1)
281 del e
282 self.profiles = []
283 - if local_config:
284 + if local_config and self.profiles:
285 custom_prof = os.path.join(
286 config_root, CUSTOM_PROFILE_PATH.lstrip(os.path.sep))
287 if os.path.exists(custom_prof):
288 @@ -7328,7 +7339,7 @@
289 writemsg_stdout("\n\n")
290 writemsg_stdout(green("Performing Global Updates: ")+bold(mykey)+"\n")
291 writemsg_stdout("(Could take a couple of minutes if you have a lot of binary packages.)\n")
292 - writemsg_stdout(" "+bold(".")+"='update pass' "+bold("*")+"='binary update' "+bold("@")+"='/var/db move'\n"+" "+bold("s")+"='/var/db SLOT move' "+bold("%")+"='binary move' "+bold("S")+"='binary SLOT move' "+bold("p")+"='update /etc/portage/package.*'\n")
293 + writemsg_stdout(" "+bold(".")+"='update pass' "+bold("*")+"='binary update' "+bold("@")+"='/var/db move'\n"+" "+bold("s")+"='/var/db SLOT move' "+bold("%")+"='binary move' "+bold("S")+"='binary SLOT move'\n "+bold("p")+"='update /etc/portage/package.*'\n")
294 valid_updates, errors = parse_updates(mycontent)
295 myupd.extend(valid_updates)
296 writemsg_stdout(len(valid_updates) * "." + "\n")