1 |
Author: zmedico |
2 |
Date: 2009-05-02 08:04:17 +0000 (Sat, 02 May 2009) |
3 |
New Revision: 13589 |
4 |
|
5 |
Modified: |
6 |
main/trunk/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. |
12 |
|
13 |
|
14 |
Modified: main/trunk/pym/_emerge/__init__.py |
15 |
=================================================================== |
16 |
--- main/trunk/pym/_emerge/__init__.py 2009-05-02 02:26:56 UTC (rev 13588) |
17 |
+++ main/trunk/pym/_emerge/__init__.py 2009-05-02 08:04:17 UTC (rev 13589) |
18 |
@@ -936,6 +936,43 @@ |
19 |
__slots__ = ("satisfied", "optional", "rebuild") |
20 |
|
21 |
def __int__(self): |
22 |
+ """ |
23 |
+ Note: These priorities are only used for measuring hardness |
24 |
+ in the circular dependency display via digraph.debug_print(), |
25 |
+ and nothing more. For actual merge order calculations, the |
26 |
+ measures defined by the DepPriorityNormalRange and |
27 |
+ DepPrioritySatisfiedRange classes are used. |
28 |
+ |
29 |
+ Attributes Hardness |
30 |
+ |
31 |
+ not satisfied and buildtime 8 |
32 |
+ not satisfied and runtime 7 |
33 |
+ not satisfied and runtime_post 6 |
34 |
+ satisfied and buildtime and rebuild 5 |
35 |
+ satisfied and buildtime 4 |
36 |
+ satisfied and runtime 3 |
37 |
+ satisfied and runtime_post 2 |
38 |
+ optional 1 |
39 |
+ (none of the above) 0 |
40 |
+ |
41 |
+ """ |
42 |
+ if not self.satisfied: |
43 |
+ if self.buildtime: |
44 |
+ return 8 |
45 |
+ if self.runtime: |
46 |
+ return 7 |
47 |
+ if self.runtime_post: |
48 |
+ return 6 |
49 |
+ if self.buildtime: |
50 |
+ if self.rebuild: |
51 |
+ return 5 |
52 |
+ return 4 |
53 |
+ if self.runtime: |
54 |
+ return 3 |
55 |
+ if self.runtime_post: |
56 |
+ return 2 |
57 |
+ if self.optional: |
58 |
+ return 1 |
59 |
return 0 |
60 |
|
61 |
def __str__(self): |