You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by sr...@apache.org on 2021/12/03 15:31:59 UTC

[plc4x] branch develop updated: fix(ci): fix prerequisite check for windows and linux

This is an automated email from the ASF dual-hosted git repository.

sruehl pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git


The following commit(s) were added to refs/heads/develop by this push:
     new 45756a4  fix(ci): fix prerequisite check for windows and linux
45756a4 is described below

commit 45756a4168826143185f52da22786ff9d71502ae
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Fri Dec 3 16:31:48 2021 +0100

    fix(ci): fix prerequisite check for windows and linux
---
 src/main/script/prerequisiteCheck.groovy | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/main/script/prerequisiteCheck.groovy b/src/main/script/prerequisiteCheck.groovy
index 454fd2a..57752aa 100644
--- a/src/main/script/prerequisiteCheck.groovy
+++ b/src/main/script/prerequisiteCheck.groovy
@@ -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
     }
@@ -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.")