1 |
Author: zmedico |
2 |
Date: 2009-05-03 20:27:06 +0000 (Sun, 03 May 2009) |
3 |
New Revision: 13601 |
4 |
|
5 |
Modified: |
6 |
main/branches/2.1.6/pym/_emerge/__init__.py |
7 |
Log: |
8 |
Fix DepPriority.__int__() to return distinguishable values, for use when |
9 |
measuring hardness for the circular dependency display. This fixes a problem |
10 |
visible in bug #268038, comment #0, where buildtime dependencies are |
11 |
incorrectly displayed as runtime dependencies. (trunk r13589) |
12 |
|
13 |
Modified: main/branches/2.1.6/pym/_emerge/__init__.py |
14 |
=================================================================== |
15 |
--- main/branches/2.1.6/pym/_emerge/__init__.py 2009-05-03 20:02:46 UTC (rev 13600) |
16 |
+++ main/branches/2.1.6/pym/_emerge/__init__.py 2009-05-03 20:27:06 UTC (rev 13601) |
17 |
@@ -917,6 +917,43 @@ |
18 |
__slots__ = ("satisfied", "optional", "rebuild") |
19 |
|
20 |
def __int__(self): |
21 |
+ """ |
22 |
+ Note: These priorities are only used for measuring hardness |
23 |
+ in the circular dependency display via digraph.debug_print(), |
24 |
+ and nothing more. For actual merge order calculations, the |
25 |
+ measures defined by the DepPriorityNormalRange and |
26 |
+ DepPrioritySatisfiedRange classes are used. |
27 |
+ |
28 |
+ Attributes Hardness |
29 |
+ |
30 |
+ not satisfied and buildtime 8 |
31 |
+ not satisfied and runtime 7 |
32 |
+ not satisfied and runtime_post 6 |
33 |
+ satisfied and buildtime and rebuild 5 |
34 |
+ satisfied and buildtime 4 |
35 |
+ satisfied and runtime 3 |
36 |
+ satisfied and runtime_post 2 |
37 |
+ optional 1 |
38 |
+ (none of the above) 0 |
39 |
+ |
40 |
+ """ |
41 |
+ if not self.satisfied: |
42 |
+ if self.buildtime: |
43 |
+ return 8 |
44 |
+ if self.runtime: |
45 |
+ return 7 |
46 |
+ if self.runtime_post: |
47 |
+ return 6 |
48 |
+ if self.buildtime: |
49 |
+ if self.rebuild: |
50 |
+ return 5 |
51 |
+ return 4 |
52 |
+ if self.runtime: |
53 |
+ return 3 |
54 |
+ if self.runtime_post: |
55 |
+ return 2 |
56 |
+ if self.optional: |
57 |
+ return 1 |
58 |
return 0 |
59 |
|
60 |
def __str__(self): |