@@ -213,16 +213,30 @@ predicate interpretModelForTest(QlBuiltins::ExtensionId madId, string model) {
213
213
)
214
214
}
215
215
216
+ bindingset [ p]
217
+ private string cleanPackage ( string p ) {
218
+ exists ( string noPrefix |
219
+ p = fixedVersionPrefix ( ) + noPrefix
220
+ or
221
+ not p = fixedVersionPrefix ( ) + any ( string s ) and
222
+ noPrefix = p
223
+ |
224
+ result = noPrefix .regexpReplaceAll ( majorVersionSuffixRegex ( ) , "" )
225
+ )
226
+ }
227
+
216
228
private predicate relevantPackage ( string package ) {
217
- sourceModel ( package , _, _, _, _, _, _, _, _, _) or
218
- sinkModel ( package , _, _, _, _, _, _, _, _, _) or
219
- summaryModel ( package , _, _, _, _, _, _, _, _, _, _)
229
+ exists ( string p | package = cleanPackage ( p ) |
230
+ sourceModel ( p , _, _, _, _, _, _, _, _, _) or
231
+ sinkModel ( p , _, _, _, _, _, _, _, _, _) or
232
+ summaryModel ( p , _, _, _, _, _, _, _, _, _, _)
233
+ )
220
234
}
221
235
222
236
private predicate packageLink ( string shortpkg , string longpkg ) {
223
237
relevantPackage ( shortpkg ) and
224
238
relevantPackage ( longpkg ) and
225
- longpkg .prefix ( longpkg .indexOf ( ". " ) ) = shortpkg
239
+ longpkg .prefix ( longpkg .indexOf ( "/ " ) ) = shortpkg
226
240
}
227
241
228
242
private predicate canonicalPackage ( string package ) {
@@ -245,26 +259,28 @@ predicate modelCoverage(string package, int pkgs, string kind, string part, int
245
259
part = "source" and
246
260
n =
247
261
strictcount ( string subpkg , string type , boolean subtypes , string name , string signature ,
248
- string ext , string output , string provenance |
262
+ string ext , string output , string provenance , string x |
249
263
canonicalPkgLink ( package , subpkg ) and
250
- sourceModel ( subpkg , type , subtypes , name , signature , ext , output , kind , provenance , _)
264
+ subpkg = cleanPackage ( x ) and
265
+ sourceModel ( x , type , subtypes , name , signature , ext , output , kind , provenance , _)
251
266
)
252
267
or
253
268
part = "sink" and
254
269
n =
255
270
strictcount ( string subpkg , string type , boolean subtypes , string name , string signature ,
256
- string ext , string input , string provenance |
271
+ string ext , string input , string provenance , string x |
257
272
canonicalPkgLink ( package , subpkg ) and
258
- sinkModel ( subpkg , type , subtypes , name , signature , ext , input , kind , provenance , _)
273
+ subpkg = cleanPackage ( x ) and
274
+ sinkModel ( x , type , subtypes , name , signature , ext , input , kind , provenance , _)
259
275
)
260
276
or
261
277
part = "summary" and
262
278
n =
263
279
strictcount ( string subpkg , string type , boolean subtypes , string name , string signature ,
264
- string ext , string input , string output , string provenance |
280
+ string ext , string input , string output , string provenance , string x |
265
281
canonicalPkgLink ( package , subpkg ) and
266
- summaryModel ( subpkg , type , subtypes , name , signature , ext , input , output , kind , provenance ,
267
- _)
282
+ subpkg = cleanPackage ( x ) and
283
+ summaryModel ( x , type , subtypes , name , signature , ext , input , output , kind , provenance , _)
268
284
)
269
285
)
270
286
}
0 commit comments