aboutsummaryrefslogtreecommitdiff
path: root/sysutils/nomad
diff options
context:
space:
mode:
authorJohn Hixson <jhixson@FreeBSD.org>2020-04-09 18:26:10 +0000
committerJohn Hixson <jhixson@FreeBSD.org>2020-04-09 18:26:10 +0000
commit2940ede105fefe0d1e2290b01d033bf7735c10ee (patch)
treebffd7fb1e0e66cd5524f77fc8acde80203a97853 /sysutils/nomad
parent61a298ef1e47b60199c8e30f81be9b9ba29b8a1d (diff)
downloadports-2940ede105fefe0d1e2290b01d033bf7735c10ee.tar.gz
ports-2940ede105fefe0d1e2290b01d033bf7735c10ee.zip
Notes
Diffstat (limited to 'sysutils/nomad')
-rw-r--r--sysutils/nomad/Makefile2
-rw-r--r--sysutils/nomad/distinfo6
-rw-r--r--sysutils/nomad/files/patch-helper_freeport_ephemeral__freebsd.go49
-rw-r--r--sysutils/nomad/files/patch-helper_freeport_ephemeral__freebsd__test.go21
-rw-r--r--sysutils/nomad/files/patch-vendor_github.com_docker_docker_pkg_system_mknod.go11
5 files changed, 85 insertions, 4 deletions
diff --git a/sysutils/nomad/Makefile b/sysutils/nomad/Makefile
index 46f60b36b6fd..6636df155cf2 100644
--- a/sysutils/nomad/Makefile
+++ b/sysutils/nomad/Makefile
@@ -2,7 +2,7 @@
PORTNAME= nomad
DISTVERSIONPREFIX= v
-DISTVERSION= 0.10.0
+DISTVERSION= 0.11.0
CATEGORIES= sysutils
MAINTAINER= jhixson@FreeBSD.org
diff --git a/sysutils/nomad/distinfo b/sysutils/nomad/distinfo
index f6941b67f169..b8c542ba7aad 100644
--- a/sysutils/nomad/distinfo
+++ b/sysutils/nomad/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1572028647
-SHA256 (hashicorp-nomad-v0.10.0_GH0.tar.gz) = b729ad3d29dcf8ee8bac62907ce8df5b90ca97634e729b0d2b841e55399ca488
-SIZE (hashicorp-nomad-v0.10.0_GH0.tar.gz) = 34951041
+TIMESTAMP = 1586453982
+SHA256 (hashicorp-nomad-v0.11.0_GH0.tar.gz) = 4868a493b83ad833eaf94f7b5552d1ee58aa1a5e9f6a20d86baf7b78b282c307
+SIZE (hashicorp-nomad-v0.11.0_GH0.tar.gz) = 52708805
diff --git a/sysutils/nomad/files/patch-helper_freeport_ephemeral__freebsd.go b/sysutils/nomad/files/patch-helper_freeport_ephemeral__freebsd.go
new file mode 100644
index 000000000000..e3db32b34024
--- /dev/null
+++ b/sysutils/nomad/files/patch-helper_freeport_ephemeral__freebsd.go
@@ -0,0 +1,49 @@
+--- helper/freeport/ephemeral_freebsd.go.orig 2020-04-09 18:14:37 UTC
++++ helper/freeport/ephemeral_freebsd.go
+@@ -0,0 +1,46 @@
++//+build freebsd
++
++package freeport
++
++import (
++ "fmt"
++ "os/exec"
++ "regexp"
++ "strconv"
++)
++
++/*
++$ sysctl net.inet.ip.portrange.first net.inet.ip.portrange.last
++net.inet.ip.portrange.first: 49152
++net.inet.ip.portrange.last: 65535
++*/
++
++const (
++ ephPortFirst = "net.inet.ip.portrange.first"
++ ephPortLast = "net.inet.ip.portrange.last"
++ command = "sysctl"
++)
++
++var ephPortRe = regexp.MustCompile(`^\s*(\d+)\s+(\d+)\s*$`)
++
++func getEphemeralPortRange() (int, int, error) {
++ cmd := exec.Command(command, "-n", ephPortFirst, ephPortLast)
++ out, err := cmd.Output()
++ if err != nil {
++ return 0, 0, err
++ }
++
++ val := string(out)
++
++ m := ephPortRe.FindStringSubmatch(val)
++ if m != nil {
++ min, err1 := strconv.Atoi(m[1])
++ max, err2 := strconv.Atoi(m[2])
++
++ if err1 == nil && err2 == nil {
++ return min, max, nil
++ }
++ }
++
++ return 0, 0, fmt.Errorf("unexpected sysctl value %q for keys %q %q", val, ephPortFirst, ephPortLast)
++}
diff --git a/sysutils/nomad/files/patch-helper_freeport_ephemeral__freebsd__test.go b/sysutils/nomad/files/patch-helper_freeport_ephemeral__freebsd__test.go
new file mode 100644
index 000000000000..1cded28ed724
--- /dev/null
+++ b/sysutils/nomad/files/patch-helper_freeport_ephemeral__freebsd__test.go
@@ -0,0 +1,21 @@
+--- helper/freeport/ephemeral_freebsd_test.go.orig 2020-04-09 18:14:37 UTC
++++ helper/freeport/ephemeral_freebsd_test.go
+@@ -0,0 +1,18 @@
++//+build freebsd
++
++package freeport
++
++import (
++ "testing"
++)
++
++func TestGetEphemeralPortRange(t *testing.T) {
++ min, max, err := getEphemeralPortRange()
++ if err != nil {
++ t.Fatalf("err: %v", err)
++ }
++ if min <= 0 || max <= 0 || min > max {
++ t.Fatalf("unexpected values: min=%d, max=%d", min, max)
++ }
++ t.Logf("min=%d, max=%d", min, max)
++}
diff --git a/sysutils/nomad/files/patch-vendor_github.com_docker_docker_pkg_system_mknod.go b/sysutils/nomad/files/patch-vendor_github.com_docker_docker_pkg_system_mknod.go
new file mode 100644
index 000000000000..f1f68d87b64b
--- /dev/null
+++ b/sysutils/nomad/files/patch-vendor_github.com_docker_docker_pkg_system_mknod.go
@@ -0,0 +1,11 @@
+--- vendor/github.com/docker/docker/pkg/system/mknod.go.orig 2020-04-08 15:42:19 UTC
++++ vendor/github.com/docker/docker/pkg/system/mknod.go
+@@ -9,7 +9,7 @@ import (
+ // Mknod creates a filesystem node (file, device special file or named pipe) named path
+ // with attributes specified by mode and dev.
+ func Mknod(path string, mode uint32, dev int) error {
+- return unix.Mknod(path, mode, dev)
++ return unix.Mknod(path, mode, uint64(dev))
+ }
+
+ // Mkdev is used to build the value of linux devices (in /dev/) which specifies major