feat(debian): possibilité d'interpreter ou non la version attendue comme un patron

This commit is contained in:
wpetit 2022-06-16 17:00:23 +02:00
parent cf66210f4e
commit 9cf903ce41
1 changed files with 2 additions and 1 deletions

View File

@ -2,6 +2,7 @@ def waitForRepoPackage(String packageName, Map params = [:]) {
def expectedVersion = params.expectedVersion ? params.expectedVersion : null
def delay = params.delay ? params.delay : 30
def waitTimeout = params.timeout ? params.timeout : 2400
def asPattern = params.containsKey("asPattern") ? params.asPattern : true
def message = "Waiting for package '${packageName}'"
if (expectedVersion != null) {
@ -28,7 +29,7 @@ def waitForRepoPackage(String packageName, Map params = [:]) {
}
def versionFound = packages.find {
def matches = it['version'] =~ expectedVersion
def matches = asPattern ? it['version'] =~ expectedVersion : it['version'] == expectedVersion
println("Comparing expected version '${expectedVersion}' to '${it['version']}': ${matches}")
return matches
}