aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@theqtcompany.com>2016-06-08 10:33:44 +0200
committerChristian Kandeler <christian.kandeler@theqtcompany.com>2016-06-08 08:43:22 +0000
commita98416dcf9895ad6f840a0e35da10a667a8a20ae (patch)
treef2f37989b82b36212920e63161cb064a36c02545
parenta9f70a366fdc47d58057116ae70c2d20dfa9c5f3 (diff)
Revert "Fix version validation for limits of 1,1."
Abovementioned patch is completely broken. Now e.g. version validators with min == max == 2 always cause errors for correctly formed version numbers. No more patches in this area will be accepted without an autotest. I also strongly suggest not to throw hard errors anymore for this kind of thing. This reverts commit a9f70a366fdc47d58057116ae70c2d20dfa9c5f3. Change-Id: I4d9c803cc2f914f05b888ea90c13a686479c4f96 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
-rw-r--r--share/qbs/imports/qbs/ModUtils/utils.js5
1 files changed, 1 insertions, 4 deletions
diff --git a/share/qbs/imports/qbs/ModUtils/utils.js b/share/qbs/imports/qbs/ModUtils/utils.js
index 2d6cdea8f..f019bec6f 100644
--- a/share/qbs/imports/qbs/ModUtils/utils.js
+++ b/share/qbs/imports/qbs/ModUtils/utils.js
@@ -322,10 +322,7 @@ var PropertyValidator = (function () {
this.addCustomValidator(propertyName, propertyValue, function (value) {
if (typeof value !== "string")
return false;
- var comps = "";
- if ((maxComponents - minComponents) > 0)
- comps = "(\\.[0-9]+){" + ((minComponents - 1) || 0) + "," + ((maxComponents - 1) || "") + "}";
- return value && value.match("^[0-9]+" + comps + (!allowSuffixes ? "$" : "")) !== null;
+ return value && value.match("^[0-9]+(\\.[0-9]+){" + ((minComponents - 1) || 0) + "," + ((maxComponents - 1) || "") + "}" + (!allowSuffixes ? "$" : "")) !== null;
}, "must be a version number with " + (minComponents === maxComponents
? minComponents : (minComponents + " to " + maxComponents))
+ (minComponents === maxComponents && minComponents === 1