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 11:57:50 UTC

[plc4x] branch develop updated: fix(ci): add prerequisite check for libpcap

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 1ebba46  fix(ci): add prerequisite check for libpcap
1ebba46 is described below

commit 1ebba465d911222613286696222530fc83641423
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Fri Dec 3 12:57:39 2021 +0100

    fix(ci): add prerequisite check for libpcap
---
 src/main/script/prerequisiteCheck.groovy | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/src/main/script/prerequisiteCheck.groovy b/src/main/script/prerequisiteCheck.groovy
index b232e96..454fd2a 100644
--- a/src/main/script/prerequisiteCheck.groovy
+++ b/src/main/script/prerequisiteCheck.groovy
@@ -411,6 +411,20 @@ def checkDocker() {
     // TODO: Implement the actual check ...
 }
 
+def checkLibPcap() {
+    try {
+        def versionString = org.pcap4j.core.Pcaps.libVersion()
+        String version = versionString - ~/^libpcap version /
+        def result =  checkVersionAtLeast(version, "1.10.1")
+        if (!result) {
+            allConditionsMet = false
+        }
+    } catch (Error e) {
+        println "missing"
+        allConditionsMet = false
+    }
+}
+
 /**
  * Version extraction function/macro. It looks for occurrence of x.y or x.y.z
  * in passed input text (likely output from `program --version` command if found).
@@ -558,6 +572,8 @@ if (cppEnabled && (os == "win")) {
     allConditionsMet = false
 }
 
+checkLibPcap()
+
 if (!allConditionsMet) {
     throw new RuntimeException("Not all conditions met, see log for details.")
 }