aboutsummaryrefslogtreecommitdiff
path: root/vars/utils.groovy
diff options
context:
space:
mode:
Diffstat (limited to 'vars/utils.groovy')
-rw-r--r--vars/utils.groovy18
1 files changed, 18 insertions, 0 deletions
diff --git a/vars/utils.groovy b/vars/utils.groovy
index 5390929..7b74187 100644
--- a/vars/utils.groovy
+++ b/vars/utils.groovy
@@ -726,6 +726,24 @@ def run(configs, concurrent = true) {
}
+// Condense version triplet and replace version specifier(s) with human-readable text
+//
+// @param String s string containing version specifiers
+// @return String string with converted version specifiers
+String convert_specifiers(String s) {
+ String result = s
+ result = result.replaceAll("\\.", "") // No period
+ .replaceAll(",", "") // No comma
+ .replaceAll("<", "L") // Less than
+ .replaceAll(">", "G") // Greater than
+ .replaceAll("~=", "C") // Compatible (GE x.y && L x.*)
+ .replaceAll("=", "E") // Equal to (=, E | ==, EE)
+ .replaceAll("\\!", "N") // Not equal to
+
+ return result
+}
+
+
// Convenience function that performs a deep copy on the supplied object.
//
// @param obj Java/Groovy object to copy