ElasticSearch7, samba patches

Autumn Jolitz autumn.jolitz at gmail.com
Mon Mar 21 10:08:32 PDT 2022


Hi,

My use case: DragonFly server that holds Time Machine Backups, holds file index from `fscrawler` and queries via elasticsearch7.

I’ve successfully:
- patched the latest ElasticSearch7 tag (one small patch) and run it via a modified `elasticsearch.in` from Freshports with openjdk16.
- patched the FreeBSD patch `patch-linuxisms` to use the additions for sscanf so http.c can successfully read an ElasticSearch response

Would someone be able to direct me to a relatively up to date method or writeup or help with contributing my work back to dports?

I ended up making binary packages in samba412 via `make clean all package` and copying the pkg file into a configured local pkg repo and locked to avoid being routinely stomped by the Avalon `samba412` which always misses `vfs_fruit.so` (critical for TimeMachine and other Macs to just work)

Autumn

Patch for ElasticSearch tag v7.17.1:

(cpython37) nyx:~/elasticsearch [(tags/v7.17.1^0)]$ git diff
diff --git a/build-tools/src/main/java/org/elasticsearch/gradle/OS.java b/build-tools/src/main/java/org/elasticsearch/gradle/OS.java
index e00c4420..ea51357a 100644
--- a/build-tools/src/main/java/org/elasticsearch/gradle/OS.java
+++ b/build-tools/src/main/java/org/elasticsearch/gradle/OS.java
@@ -23,7 +23,7 @@ public enum OS {
         if (os.startsWith("Windows")) {
             return OS.WINDOWS;
         }
-        if (os.startsWith("Linux") || os.startsWith("LINUX")) {
+        if (os.startsWith("Linux") || os.startsWith("LINUX") || os.startsWith("DragonFly")) {
             return OS.LINUX;
         }
         if (os.startsWith("Mac")) {
(cpython37) nyx:~/elasticsearch [(tags/v7.17.1^0)]$

Patch for dports files/patch-linuxisms:

(cpython37) nyx:/usr/dports [master]$ git diff
diff --git a/net/samba412/files/patch-linuxisms b/net/samba412/files/patch-linuxisms
index bea5adb5718..bd7d22630dd 100644
--- a/net/samba412/files/patch-linuxisms
+++ b/net/samba412/files/patch-linuxisms
@@ -4,7 +4,7 @@
                return HTTP_ALL_DATA_READ;
        }

-+#ifdef FREEBSD
++#if defined(FREEBSD) || defined(__DragonFly__)
 +      int s0, s1, s2, s3; s0 = s1 = s2 = s3 = 0;
 +      n = sscanf(line, "%n%*[^:]%n: %n%*[^\r\n]%n\r\n", &s0, &s1, &s2, &s3);
 +
@@ -33,7 +33,7 @@
                return false;
        }

-+#ifdef FREEBSD
++#if defined(FREEBSD) || defined(__DragonFly__)
 +      int s0, s1, s2, s3; s0 = s1 = s2 = s3 = 0;
 +      n = sscanf(line, "%n%*[^/]%n/%c.%c %d %n%*[^\r\n]%n\r\n",
 +                 &s0, &s1, &major, &minor, &code, &s2, &s3);
(cpython37) nyx:/usr/dports [master]$



More information about the Users mailing list