1 |
Author: grobian |
2 |
Date: 2008-09-01 18:48:49 +0000 (Mon, 01 Sep 2008) |
3 |
New Revision: 11484 |
4 |
|
5 |
Modified: |
6 |
main/branches/prefix/cnf/make.globals |
7 |
main/branches/prefix/man/make.conf.5 |
8 |
main/branches/prefix/pym/portage/__init__.py |
9 |
main/branches/prefix/pym/portage/dbapi/vartree.py |
10 |
main/branches/prefix/pym/repoman/checks.py |
11 |
main/branches/prefix/pym/repoman/errors.py |
12 |
Log: |
13 |
Merged from trunk -r11477:11483 |
14 |
|
15 |
| 11478 | In dep_zapdeps(), add a new choice category for choices that | |
16 |
| zmedico | have packages that aren't yet installed but have been added | |
17 |
| | to the graph. This category is given lower priority that the | |
18 |
| | category for packages that are already installed. This helps | |
19 |
| | dep_zapdeps() avoid making choices in some cases that would | |
20 |
| | result in an unsolvable circular dependency. Thanks to Diego | |
21 |
| | "Flameeyes" Petten?\195?\178 for reporting a circular dependency | |
22 |
| | issue involving that java overlay which is solved by this | |
23 |
| | patch. The particular issue was triggered when attempting to | |
24 |
| | install dev-java/icedtea6 for the first time. A circular | |
25 |
| | dependency between dev-java/eclipse-ecj-3.2.2-r1 and | |
26 |
| | dev-java/icedtea6-1.2 occured since icedtea6 was chosen to | |
27 |
| | satisfy the jdk dependency of eclipse-ecj, even though | |
28 |
| | sun-jdk-1.6.0.07 was already installed and capable of | |
29 |
| | satisfying the dependency. This patch solves the issue by | |
30 |
| | causing sun-jdk to be properly selected to satisfy the jdk | |
31 |
| | dependency of eclipse-ecj. | |
32 |
|
33 |
| 11479 | Add support for FEATURES="protect-owned" which is identical | |
34 |
| zmedico | to the collision-protect feature except that files may be | |
35 |
| | overwritten if they are not explicitly listed in the | |
36 |
| | contents of a currently installed package. This is | |
37 |
| | particularly useful on systems that have lots of orphan | |
38 |
| | files that have been left behind by older versions of | |
39 |
| | portage that did not support the unmerge-orphans feature. | |
40 |
| | The additional tolerance makes this feature more suitable | |
41 |
| | than collision-protect for being enabled by default. In | |
42 |
| | order to ensure smooth operation of protect-owned in all | |
43 |
| | cases, we also have to set COLLISION_IGNORE="/lib/modules" | |
44 |
| | since files inside this directory are never unmerge. By | |
45 |
| | enabling protect-owned by default, users are protected from | |
46 |
| | problems that may occur due interactions with file | |
47 |
| | collisions and the unmerge-orphans feature which is also | |
48 |
| | enabled by default. | |
49 |
|
50 |
| 11480 | Add a warning for emake -j1 calls which disable | |
51 |
| zmedico | parallelization. Thanks to Diego "Flameeyes" Petten?\195?\178 for | |
52 |
| | the suggestion. | |
53 |
|
54 |
| 11481 | Check for calls to the deprecated bindnow-flags function. | |
55 |
| zmedico | Thanks to Diego "Flameeyes" Petten?\195?\178 for the suggestion. | |
56 |
|
57 |
| 11482 | Adjust EMakeParallelDisabled.re to require at least one | |
58 |
| zmedico | space after emake. | |
59 |
|
60 |
| 11483 | Update PORTAGE_RSYNC_OPTS docs to reflect that | |
61 |
| zmedico | --delete-after is no longer used by default. | |
62 |
|
63 |
|
64 |
Modified: main/branches/prefix/cnf/make.globals |
65 |
=================================================================== |
66 |
--- main/branches/prefix/cnf/make.globals 2008-09-01 17:06:38 UTC (rev 11483) |
67 |
+++ main/branches/prefix/cnf/make.globals 2008-09-01 18:48:49 UTC (rev 11484) |
68 |
@@ -38,8 +38,14 @@ |
69 |
RESUMECOMMAND="wget -c -t 5 -T 60 --passive-ftp -O \"\${DISTDIR}/\${FILE}\" \"\${URI}\"" |
70 |
|
71 |
# Default user options |
72 |
-FEATURES="distlocks parallel-fetch sandbox sfperms strict unmerge-orphans userfetch" |
73 |
+FEATURES="distlocks parallel-fetch protect-owned sandbox |
74 |
+ sfperms strict unmerge-orphans userfetch" |
75 |
|
76 |
+# Ignore file collisions in /lib/modules since files inside this directory |
77 |
+# are never unmerged, and therefore collisions must be ignored in order for |
78 |
+# FEATURES=protect-owned to operate smoothly in all cases. |
79 |
+COLLISION_IGNORE="/lib/modules" |
80 |
+ |
81 |
# Enable for global testing |
82 |
FEATURES="${FEATURES} preserve-libs" |
83 |
|
84 |
|
85 |
Modified: main/branches/prefix/man/make.conf.5 |
86 |
=================================================================== |
87 |
--- main/branches/prefix/man/make.conf.5 2008-09-01 17:06:38 UTC (rev 11483) |
88 |
+++ main/branches/prefix/man/make.conf.5 2008-09-01 18:48:49 UTC (rev 11484) |
89 |
@@ -82,8 +82,10 @@ |
90 |
Defaults to 5 seconds. |
91 |
.TP |
92 |
\fBCOLLISION_IGNORE\fR = \fI[space delimited list of files and/or directories]\fR |
93 |
-This variable allows the user to disable \fIcollision\-protect\fR for specific |
94 |
-files and/or directories. |
95 |
+This variable allows the user to disable \fIcollision\-protect\fR and |
96 |
+\fIprotect\-owned\fR for specific files and/or directories. |
97 |
+.br |
98 |
+Defaults to /lib/modules. |
99 |
.TP |
100 |
\fBCONFIG_PROTECT\fR = \fI[space delimited list of files and/or directories]\fR |
101 |
All files and/or directories that are defined here will have "config file protection" |
102 |
@@ -171,7 +173,7 @@ |
103 |
.B collision\-protect |
104 |
A QA\-feature to ensure that a package doesn't overwrite files it doesn't own. |
105 |
The \fICOLLISION_IGNORE\fR variable can be used to selectively disable this |
106 |
-feature. |
107 |
+feature. Also see the related \fIprotect\-owned\fR feature. |
108 |
.TP |
109 |
.B digest |
110 |
Autogenerate digests for packages when running the \fBemerge\fR(1) command. If |
111 |
@@ -267,6 +269,20 @@ |
112 |
`tail \-f /var/log/emerge\-fetch.log` in a |
113 |
terminal to view parallel-fetch progress. |
114 |
.TP |
115 |
+.B protect\-owned |
116 |
+This is identical to the \fIcollision\-protect\fR feature except that files |
117 |
+may be overwritten if they are not explicitly listed in the contents of a |
118 |
+currently installed package. This is particularly useful on systems that |
119 |
+have lots of orphan files that have been left behind by older versions |
120 |
+of portage that did not support the \fIunmerge\-orphans\fR feature. Like |
121 |
+\fIcollision\-protect\fR, the \fICOLLISION_IGNORE\fR variable can be used to |
122 |
+selectively disable this feature. It is recommended to leave either |
123 |
+\fIprotect\-owned\fR or \fIcollision\-protect\fR enabled at all times, |
124 |
+since otherwise file collisions between packages may result in files being |
125 |
+overwritten or uninstalled at inappropriate times. |
126 |
+If \fIcollision\-protect\fR is enabled then it takes precedence over |
127 |
+\fIprotect\-owned\fR. |
128 |
+.TP |
129 |
.B sandbox |
130 |
Enable sandbox\-ing when running \fBemerge\fR(1) and \fBebuild\fR(1). |
131 |
.TP |
132 |
@@ -321,7 +337,7 @@ |
133 |
and \fIsrc_test()\fR in \fBebuild\fR(5). This feature implies the "test" |
134 |
\fBUSE\fR flag. |
135 |
.TP |
136 |
-.B unmerge-orphans |
137 |
+.B unmerge\-orphans |
138 |
If a file is not claimed by another package in the same slot and it is not |
139 |
protected by \fICONFIG_PROTECT\fR, unmerge it even if the modification time or |
140 |
checksum differs from the file that was originally installed. |
141 |
@@ -500,7 +516,7 @@ |
142 |
\fBDon't change this unless you know exactly what you're doing!\fR |
143 |
.br |
144 |
Defaults to "\-\-recursive \-\-links \-\-safe\-links \-\-perms \-\-times |
145 |
-\-\-compress \-\-force \-\-whole\-file \-\-delete \-\-delete\-after \-\-stats |
146 |
+\-\-compress \-\-force \-\-whole\-file \-\-delete \-\-stats |
147 |
\-\-timeout=180 \-\-exclude='/distfiles' \-\-exclude='/local' |
148 |
\-\-exclude='/packages'" |
149 |
.TP |
150 |
|
151 |
Modified: main/branches/prefix/pym/portage/__init__.py |
152 |
=================================================================== |
153 |
--- main/branches/prefix/pym/portage/__init__.py 2008-09-01 17:06:38 UTC (rev 11483) |
154 |
+++ main/branches/prefix/pym/portage/__init__.py 2008-09-01 18:48:49 UTC (rev 11484) |
155 |
@@ -6266,6 +6266,7 @@ |
156 |
# d) is the first item |
157 |
|
158 |
preferred = [] |
159 |
+ preferred_not_installed = [] |
160 |
preferred_any_slot = [] |
161 |
possible_upgrades = [] |
162 |
other = [] |
163 |
@@ -6346,7 +6347,7 @@ |
164 |
break |
165 |
if all_in_graph: |
166 |
if parent is None: |
167 |
- preferred.append(this_choice) |
168 |
+ preferred_not_installed.append(this_choice) |
169 |
else: |
170 |
# Check if the atom would result in a direct circular |
171 |
# dependency and try to avoid that if it seems likely |
172 |
@@ -6366,7 +6367,7 @@ |
173 |
circular_atom = atom |
174 |
break |
175 |
if circular_atom is None: |
176 |
- preferred.append(this_choice) |
177 |
+ preferred_not_installed.append(this_choice) |
178 |
else: |
179 |
other.append(this_choice) |
180 |
else: |
181 |
@@ -6380,6 +6381,7 @@ |
182 |
# into || ( highest version ... lowest version ). We want to prefer the |
183 |
# highest all_available version of the new-style virtual when there is a |
184 |
# lower all_installed version. |
185 |
+ preferred.extend(preferred_not_installed) |
186 |
preferred.extend(preferred_any_slot) |
187 |
preferred.extend(possible_upgrades) |
188 |
possible_upgrades = preferred[1:] |
189 |
|
190 |
Modified: main/branches/prefix/pym/portage/dbapi/vartree.py |
191 |
=================================================================== |
192 |
--- main/branches/prefix/pym/portage/dbapi/vartree.py 2008-09-01 17:06:38 UTC (rev 11483) |
193 |
+++ main/branches/prefix/pym/portage/dbapi/vartree.py 2008-09-01 18:48:49 UTC (rev 11484) |
194 |
@@ -3379,12 +3379,15 @@ |
195 |
|
196 |
if collisions: |
197 |
collision_protect = "collision-protect" in self.settings.features |
198 |
+ protect_owned = "protect-owned" in self.settings.features |
199 |
msg = "This package will overwrite one or more files that" + \ |
200 |
" may belong to other packages (see list below)." |
201 |
- if not collision_protect: |
202 |
- msg += " Add \"collision-protect\" to FEATURES in" + \ |
203 |
+ if not (collision_protect or protect_owned): |
204 |
+ msg += " Add either \"collision-protect\" or" + \ |
205 |
+ " \"protect-owned\" to FEATURES in" + \ |
206 |
" make.conf if you would like the merge to abort" + \ |
207 |
- " in cases like this." |
208 |
+ " in cases like this. See the make.conf man page for" + \ |
209 |
+ " more information about these features." |
210 |
if self.settings.get("PORTAGE_QUIET") != "1": |
211 |
msg += " You can use a command such as" + \ |
212 |
" `portageq owners / <filename>` to identify the" + \ |
213 |
@@ -3452,6 +3455,9 @@ |
214 |
if collision_protect: |
215 |
msg = "Package '%s' NOT merged due to file collisions." % \ |
216 |
self.settings.mycpv |
217 |
+ elif protect_owned and owners: |
218 |
+ msg = "Package '%s' NOT merged due to file collisions." % \ |
219 |
+ self.settings.mycpv |
220 |
else: |
221 |
msg = "Package '%s' merged despite file collisions." % \ |
222 |
self.settings.mycpv |
223 |
@@ -3459,7 +3465,7 @@ |
224 |
"messages for the whole content of the above message." |
225 |
eerror(wrap(msg, 70)) |
226 |
|
227 |
- if collision_protect: |
228 |
+ if collision_protect or (protect_owned and owners): |
229 |
return 1 |
230 |
|
231 |
# The merge process may move files out of the image directory, |
232 |
|
233 |
Modified: main/branches/prefix/pym/repoman/checks.py |
234 |
=================================================================== |
235 |
--- main/branches/prefix/pym/repoman/checks.py 2008-09-01 17:06:38 UTC (rev 11483) |
236 |
+++ main/branches/prefix/pym/repoman/checks.py 2008-09-01 18:48:49 UTC (rev 11484) |
237 |
@@ -268,12 +268,25 @@ |
238 |
if self._iuse_def is None: |
239 |
yield 'IUSE is not defined' |
240 |
|
241 |
+class EMakeParallelDisabled(LineCheck): |
242 |
+ """Check for emake -j1 calls which disable parallelization.""" |
243 |
+ repoman_check_name = 'ebuild.minorsyn' |
244 |
+ re = re.compile(r'^\s*emake\s+-j\s*1\s') |
245 |
+ error = errors.EMAKE_PARALLEL_DISABLED |
246 |
+ |
247 |
+class DeprecatedBindnowFlags(LineCheck): |
248 |
+ """Check for calls to the deprecated bindnow-flags function.""" |
249 |
+ repoman_check_name = 'ebuild.minorsyn' |
250 |
+ re = re.compile(r'.*\$\(bindnow-flags\)') |
251 |
+ error = errors.DEPRECATED_BINDNOW_FLAGS |
252 |
+ |
253 |
_constant_checks = tuple((c() for c in ( |
254 |
EbuildHeader, EbuildWhitespace, EbuildQuote, |
255 |
EbuildAssignment, EbuildUselessDodoc, |
256 |
EbuildUselessCdS, EbuildNestedDie, |
257 |
EbuildPatches, EbuildQuotedA, |
258 |
- IUseUndefined, InheritAutotools))) |
259 |
+ IUseUndefined, InheritAutotools, |
260 |
+ EMakeParallelDisabled, DeprecatedBindnowFlags))) |
261 |
|
262 |
def run_checks(contents, pkg): |
263 |
checks = _constant_checks |
264 |
|
265 |
Modified: main/branches/prefix/pym/repoman/errors.py |
266 |
=================================================================== |
267 |
--- main/branches/prefix/pym/repoman/errors.py 2008-09-01 17:06:38 UTC (rev 11483) |
268 |
+++ main/branches/prefix/pym/repoman/errors.py 2008-09-01 18:48:49 UTC (rev 11484) |
269 |
@@ -13,3 +13,5 @@ |
270 |
NESTED_DIE_ERROR = 'Ebuild calls die in a subshell on line: %d' |
271 |
PATCHES_ERROR = 'PATCHES is not a bash array on line: %d' |
272 |
REDUNDANT_CD_S_ERROR = 'Ebuild has redundant cd ${S} statement on line: %d' |
273 |
+EMAKE_PARALLEL_DISABLED = 'Ebuild calls emake -j1 on line: %d' |
274 |
+DEPRECATED_BINDNOW_FLAGS = 'Deprecated bindnow-flags call on line: %d' |