Skip to content

Commit

Permalink
fix(ci): fix prerequisite check for windows and linux
Browse files Browse the repository at this point in the history
  • Loading branch information
sruehl committed Dec 3, 2021
1 parent 3e966c8 commit 45756a4
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/main/script/prerequisiteCheck.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -411,15 +411,17 @@ def checkDocker() {
// TODO: Implement the actual check ...
}

def checkLibPcap() {
def checkLibPcap(String minVersion) {
print "Detecting LibPcap version: "
try {
def versionString = org.pcap4j.core.Pcaps.libVersion()
String version = versionString - ~/^libpcap version /
def result = checkVersionAtLeast(version, "1.10.1")
output = org.pcap4j.core.Pcaps.libVersion()
String version = output - ~/^libpcap version /
def result = checkVersionAtLeast(version, minVersion)
if (!result) {
allConditionsMet = false
}
} catch (Error e) {
output = ""
println "missing"
allConditionsMet = false
}
Expand Down Expand Up @@ -572,7 +574,10 @@ if (cppEnabled && (os == "win")) {
allConditionsMet = false
}

checkLibPcap()
if (os == "mac") {
// The current system version from mac crashes so we assert for a version coming with brew
checkLibPcap("1.10.1")
}

if (!allConditionsMet) {
throw new RuntimeException("Not all conditions met, see log for details.")
Expand Down

0 comments on commit 45756a4

Please sign in to comment.