1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
|
# R overlay --
# -*- coding: utf-8 -*-
# Copyright (C) 2013 André Erdmann <dywi@mailerd.de>
# Distributed under the terms of the GNU General Public License;
# either version 2 of the License, or (at your option) any later version.
# ready-to-use input for testing dependency resolution
EMPTY_STR = ""
RESOLVE_AS_IGNORED = lambda s: ( s, EMPTY_STR )
DONT_RESOLVE = lambda s: ( s, None )
DONT_RESOLVE_TUPLE = lambda *S: tuple ( map ( DONT_RESOLVE, S ) )
# dict <dataset name>, <tuple ( <dependency string>, <expected result> )>
#
DEPRES_DATA = {
'fftw': (
( "fftw", "sci-libs/fftw" ),
( "fftw 2", ">=sci-libs/fftw-2" ),
( "fftw 2.1.5", ">=sci-libs/fftw-2.1.5:2.1" ),
),
'slot0': (
( "p0", "cat/pkg:*" ),
DONT_RESOLVE ( "p0 !=2" ),
( "p1", "cat/pkg:=" ),
( "p2", "cat/pkg" ),
DONT_RESOLVE ( "p2 <3" ),
( "p2 =2.2.49", "=cat/pkg-2.2.49:2.2/49" ),
DONT_RESOLVE ( "p2 5" ),
DONT_RESOLVE ( "p2 5.4" ),
DONT_RESOLVE ( "p2 !5" ),
DONT_RESOLVE ( "p2 !=5" ),
DONT_RESOLVE ( "p3 1." ),
( "p3 =2.1.0", "cat/pkg:1" ),
( "p4 =5.4.3.2.1", "cat/pkg:5=" ),
( "p5 =4", "cat/pkg:99/2" ),
),
'selfdeps': (
),
'and-split' : (
( "GDAL >= 1.3.1", ">=sci-libs/gdal-1.3.1" ),
( "PROJ.4 (>= 4.4.9)", ">=sci-libs/proj-4.4.9" ),
(
'for building from source: GDAL >= 1.3.1 && GDAL < 1.6.0 '
'(until tested) library and PROJ.4 (proj >= 4.4.9)',
None
),
(
'for building from source: GDAL >= 1.3.1 '
'library and PROJ.4 (>= 4.4.9)',
( ">=sci-libs/gdal-1.3.1", ">=sci-libs/proj-4.4.9" ),
),
),
'empty': DONT_RESOLVE_TUPLE ( "fftw", ),
# examples from doc/rst/usage.rst
'example1': (
( "r 2.12", ">=dev-lang/R-2.12" ),
( "R(>= 2.14)", ">=dev-lang/R-2.14" ),
( "R [<2.10]", "<dev-lang/R-2.10" ),
( "r{ !=2.12 }", "( !=dev-lang/R-2.12 dev-lang/R )" ),
( "R", "dev-lang/R" ),
DONT_RESOLVE ( "R (!2)" ),
),
'example2': (
# depends on DEFAULT_CATEGORY
( 'zoo', 'sci-R/zoo' ),
DONT_RESOLVE ( 'zoo 5' ),
),
'example3': (
( 'BLAS/LAPACK libraries', '( virtual/blas virtual/lapack )' ),
),
'example4': (
RESOLVE_AS_IGNORED ( "see README" ),
RESOLVE_AS_IGNORED ( "read INSTALL" ),
RESOLVE_AS_IGNORED (
"Will use djmrgl or rgl packages for rendering if present"
),
),
'example5': (
( "fftw", "sci-libs/fftw" ),
DONT_RESOLVE ( "fftw 2" ),
( "fftw 2.1", "sci-libs/fftw:2.1" ),
( "fftw 2.1.2", "sci-libs/fftw:2.1" ),
( "fftw 2.1.3", "sci-libs/fftw:2.1" ),
( "fftw [ <=2.2]", "sci-libs/fftw:2.2" ),
( "fftw (=3.0)", "sci-libs/fftw:3.0" ),
# !!
( "fftw (=3.2)", "sci-libs/fftw:3.2" ),
DONT_RESOLVE ( "fftw ( != 5 )" ),
),
'example6': (
( "fftw", "sci-libs/fftw" ),
DONT_RESOLVE ( "fftw 2" ),
( "fftw 2.1", "sci-libs/fftw:2.1" ),
( "fftw 2.1.2", "sci-libs/fftw:2.1" ),
( "fftw 2.1.3", "sci-libs/fftw:2.1" ),
DONT_RESOLVE ( "fftw [ <=2.2]" ),
( "fftw (=3.0)", "sci-libs/fftw:3.0" ),
# !!
DONT_RESOLVE ( "fftw (=3.2)" ),
DONT_RESOLVE ( "fftw ( != 5 )" ),
),
'example5+6' : 'example5',
'example7': (
DONT_RESOLVE ( "fftw (=2.1)" ),
( "fftw (=3.0)", "sci-libs/fftw:3.0" ),
( "fftw (=3.1)", "sci-libs/fftw:3.0" ),
( "fftw (=3.2)", "sci-libs/fftw:3.0" ),
( "fftw (=3.3)", "sci-libs/fftw:3.0" ),
),
}
# dict <ruleset name>, <m-tuples>( <rule file line>^m )
DEPRES_RULES = {
'fftw': (
'sci-libs/fftw {', 'fftw', '}',
'~sci-libs/fftw:wide_match:+v:s=..1 :: fftw',
'~sci-libs/fftw :: fftw',
),
'slot0': (
'~cat/pkg:open:* :: p0',
'~cat/pkg:open: :: p1',
'~cat/pkg:with_version:s=..1:/2 :: p2',
'~cat/pkg:s=1 :: p3',
'~cat/pkg:= :: p4',
'~cat/pkg:s=i99:/i2 :: p5',
),
'selfdeps': (
'@selfdep', '~other-cat/pkg :: zoo',
),
'and-split': (
'~sci-libs/gdal :: gdal',
'~sci-libs/proj {', 'proj', 'proj.4', '}',
),
'empty': (),
# examples from doc/rst/usage.rst
'example1': (
'~dev-lang/R :: R',
),
'example2': (
'zoo',
),
'example3': (
'( virtual/blas virtual/lapack ) {',
'BLAS/LAPACK libraries',
'}',
),
'example4': (
'! {',
'see README',
'read INSTALL',
'Will use djmrgl or rgl packages for rendering if present',
'}',
),
'example5': (
'~sci-libs/fftw:wide_match:s=0..1 :: fftw',
),
'example6': (
'~sci-libs/fftw:wide_match:s=0..1:restrict=2.1,3.0: :: fftw',
),
'example7': (
'~sci-libs/fftw:wide_match:s=i3.0:r=3.0,3.1,3.2,3.3 :: fftw',
),
}
# dict <dataset name>, <iterable|str <ruleset name(s)>>
# datasets not listed here default to <dataset name> as <ruleset name>
DEPRES_INCLUDE = {
'example5+6': ( "example5", "example6", ),
}
#DEPRES_FAULTY_RULES=...
|