sysutils/nomad: update to v0.11.0

This commit is contained in:
John Hixson 2020-04-09 18:26:10 +00:00
parent 61a298ef1e
commit 2940ede105
5 changed files with 85 additions and 4 deletions

View file

@ -2,7 +2,7 @@
PORTNAME= nomad
DISTVERSIONPREFIX= v
DISTVERSION= 0.10.0
DISTVERSION= 0.11.0
CATEGORIES= sysutils
MAINTAINER= jhixson@FreeBSD.org

View file

@ -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

View file

@ -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)
+}

View file

@ -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)
+}

View file

@ -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