Commit 286150ab authored by Anthony Mallet's avatar Anthony Mallet
Browse files

[mk] Fix a corner case issue in dependency constraint reduction

When dealing with multiple constraints on a package (e.g x>n x>m), it could
happen that the lower/upper bounds on the constraint would be incorrectly
computed if the different version numbers would have a different number of
comonents AND the other side of the bound would be longer as well
(e.g: x>=1<3.0 x>=2.1). This was in practice not triggered by any existing
package.

Fix that by making sure to reset the array encoding the min/max constraint
before updating it.
parent 794b22c3
#!/usr/bin/awk -f
#
# Copyright (c) 2011,2013 LAAS/CNRS
# Copyright (c) 2011,2013,2018 LAAS/CNRS
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
......@@ -191,13 +191,13 @@ function reduce(targets, recursion, a, i, k, t, p, name, min, minop, max,
if (t == DEWEY_LT || t == DEWEY_LE || t == DEWEY_EQ) {
if (!maxop || vtest(cur, maxop, max)) {
for (i in cur) max[i] = cur[i]
split("", max); for (i in cur) max[i] = cur[i]
maxop = t == DEWEY_EQ ? DEWEY_LE : t
}
}
if (t == DEWEY_GT || t == DEWEY_GE || t == DEWEY_EQ) {
if (!minop || vtest(cur, minop, min)) {
for (i in cur) min[i] = cur[i]
split("", min); for (i in cur) min[i] = cur[i]
minop = t == DEWEY_EQ ? DEWEY_GE : t
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment