From owner-svn-ports-head@freebsd.org Wed Jan 3 20:24:20 2018 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12079EADB06; Wed, 3 Jan 2018 20:24:20 +0000 (UTC) (envelope-from lifanov@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D1BD864A70; Wed, 3 Jan 2018 20:24:19 +0000 (UTC) (envelope-from lifanov@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w03KOJG1054680; Wed, 3 Jan 2018 20:24:19 GMT (envelope-from lifanov@FreeBSD.org) Received: (from lifanov@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w03KOIYY054671; Wed, 3 Jan 2018 20:24:18 GMT (envelope-from lifanov@FreeBSD.org) Message-Id: <201801032024.w03KOIYY054671@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lifanov set sender to lifanov@FreeBSD.org using -f From: Nikolai Lifanov Date: Wed, 3 Jan 2018 20:24:18 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r458002 - in head/sysutils/docker: . files X-SVN-Group: ports-head X-SVN-Commit-Author: lifanov X-SVN-Commit-Paths: in head/sysutils/docker: . files X-SVN-Commit-Revision: 458002 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jan 2018 20:24:20 -0000 Author: lifanov Date: Wed Jan 3 20:24:18 2018 New Revision: 458002 URL: https://svnweb.freebsd.org/changeset/ports/458002 Log: update sysutils/docker to 17.12.0 This update introduces patches that will be upstreamed. Thanks to yuri for bugging me about it! PR: 224784 Added: head/sysutils/docker/files/ head/sysutils/docker/files/patch-components_cli_cli_config_credentials_default__store__freebsd.go (contents, props changed) head/sysutils/docker/files/patch-components_cli_cli_config_credentials_default__store__unsupported.go (contents, props changed) head/sysutils/docker/files/patch-components_cli_vendor_github.com_docker_docker-credential-helpers_pass_pass__freebsd.go (contents, props changed) head/sysutils/docker/files/patch-components_cli_vendor_github.com_docker_docker_pkg_archive_archive__unix.go (contents, props changed) head/sysutils/docker/files/patch-components_cli_vendor_github.com_docker_docker_pkg_archive_changes__unix.go (contents, props changed) head/sysutils/docker/files/patch-components_cli_vendor_github.com_tonistiigi_fsutil_diskwriter__freebsd.go (contents, props changed) head/sysutils/docker/files/patch-components_cli_vendor_github.com_tonistiigi_fsutil_walker__unix.go (contents, props changed) Modified: head/sysutils/docker/Makefile head/sysutils/docker/distinfo Modified: head/sysutils/docker/Makefile ============================================================================== --- head/sysutils/docker/Makefile Wed Jan 3 20:01:08 2018 (r458001) +++ head/sysutils/docker/Makefile Wed Jan 3 20:24:18 2018 (r458002) @@ -2,7 +2,7 @@ # $FreeBSD$ PORTNAME= docker -PORTVERSION= 17.06.1 +PORTVERSION= 17.12.0 DISTVERSIONPREFIX= v DISTVERSIONSUFFIX= -ce CATEGORIES= sysutils Modified: head/sysutils/docker/distinfo ============================================================================== --- head/sysutils/docker/distinfo Wed Jan 3 20:01:08 2018 (r458001) +++ head/sysutils/docker/distinfo Wed Jan 3 20:24:18 2018 (r458002) @@ -1,3 +1,3 @@ -TIMESTAMP = 1503236000 -SHA256 (docker-docker-ce-v17.06.1-ce_GH0.tar.gz) = 2ca8615162873b32d9565f95a4b2977d025fd44c69e087046e004f5dfb1ce30c -SIZE (docker-docker-ce-v17.06.1-ce_GH0.tar.gz) = 9682381 +TIMESTAMP = 1515007414 +SHA256 (docker-docker-ce-v17.12.0-ce_GH0.tar.gz) = 945e3eb62e35e9399983a956299bbbf878442c5a164262ed82b7aa7366731a83 +SIZE (docker-docker-ce-v17.12.0-ce_GH0.tar.gz) = 11011208 Added: head/sysutils/docker/files/patch-components_cli_cli_config_credentials_default__store__freebsd.go ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/docker/files/patch-components_cli_cli_config_credentials_default__store__freebsd.go Wed Jan 3 20:24:18 2018 (r458002) @@ -0,0 +1,16 @@ +--- components/cli/cli/config/credentials/default_store_freebsd.go.orig 2018-01-03 19:51:59 UTC ++++ components/cli/cli/config/credentials/default_store_freebsd.go +@@ -0,0 +1,13 @@ ++package credentials ++ ++import ( ++ "github.com/docker/docker-credential-helpers/pass" ++) ++ ++func defaultCredentialsStore() string { ++ if pass.PassInitialized { ++ return "pass" ++ } ++ ++ return "secretservice" ++} Added: head/sysutils/docker/files/patch-components_cli_cli_config_credentials_default__store__unsupported.go ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/docker/files/patch-components_cli_cli_config_credentials_default__store__unsupported.go Wed Jan 3 20:24:18 2018 (r458002) @@ -0,0 +1,8 @@ +--- components/cli/cli/config/credentials/default_store_unsupported.go.orig 2017-12-27 17:03:35 UTC ++++ components/cli/cli/config/credentials/default_store_unsupported.go +@@ -1,4 +1,4 @@ +-// +build !windows,!darwin,!linux ++// +build !windows,!darwin,!linux,!freebsd + + package credentials + Added: head/sysutils/docker/files/patch-components_cli_vendor_github.com_docker_docker-credential-helpers_pass_pass__freebsd.go ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/docker/files/patch-components_cli_vendor_github.com_docker_docker-credential-helpers_pass_pass__freebsd.go Wed Jan 3 20:24:18 2018 (r458002) @@ -0,0 +1,211 @@ +--- components/cli/vendor/github.com/docker/docker-credential-helpers/pass/pass_freebsd.go.orig 2018-01-03 19:51:59 UTC ++++ components/cli/vendor/github.com/docker/docker-credential-helpers/pass/pass_freebsd.go +@@ -0,0 +1,208 @@ ++// A `pass` based credential helper. Passwords are stored as arguments to pass ++// of the form: "$PASS_FOLDER/base64-url(serverURL)/username". We base64-url ++// encode the serverURL, because under the hood pass uses files and folders, so ++// /s will get translated into additional folders. ++package pass ++ ++import ( ++ "encoding/base64" ++ "errors" ++ "fmt" ++ "io/ioutil" ++ "os" ++ "os/exec" ++ "path" ++ "strings" ++ ++ "github.com/docker/docker-credential-helpers/credentials" ++) ++ ++const PASS_FOLDER = "docker-credential-helpers" ++ ++var ( ++ PassInitialized bool ++) ++ ++func init() { ++ PassInitialized = exec.Command("pass").Run() == nil ++} ++ ++func runPass(stdinContent string, args ...string) (string, error) { ++ cmd := exec.Command("pass", args...) ++ ++ stdin, err := cmd.StdinPipe() ++ if err != nil { ++ return "", err ++ } ++ defer stdin.Close() ++ ++ stderr, err := cmd.StderrPipe() ++ if err != nil { ++ return "", err ++ } ++ defer stderr.Close() ++ ++ stdout, err := cmd.StdoutPipe() ++ if err != nil { ++ return "", err ++ } ++ defer stdout.Close() ++ ++ err = cmd.Start() ++ if err != nil { ++ return "", err ++ } ++ ++ _, err = stdin.Write([]byte(stdinContent)) ++ if err != nil { ++ return "", err ++ } ++ stdin.Close() ++ ++ errContent, err := ioutil.ReadAll(stderr) ++ if err != nil { ++ return "", fmt.Errorf("error reading stderr: %s", err) ++ } ++ ++ result, err := ioutil.ReadAll(stdout) ++ if err != nil { ++ return "", fmt.Errorf("Error reading stdout: %s", err) ++ } ++ ++ cmdErr := cmd.Wait() ++ if cmdErr != nil { ++ return "", fmt.Errorf("%s: %s", cmdErr, errContent) ++ } ++ ++ return string(result), nil ++} ++ ++// Pass handles secrets using Linux secret-service as a store. ++type Pass struct{} ++ ++// Add adds new credentials to the keychain. ++func (h Pass) Add(creds *credentials.Credentials) error { ++ if !PassInitialized { ++ return errors.New("pass store is uninitialized") ++ } ++ ++ if creds == nil { ++ return errors.New("missing credentials") ++ } ++ ++ encoded := base64.URLEncoding.EncodeToString([]byte(creds.ServerURL)) ++ ++ _, err := runPass(creds.Secret, "insert", "-f", "-m", path.Join(PASS_FOLDER, encoded, creds.Username)) ++ return err ++} ++ ++// Delete removes credentials from the store. ++func (h Pass) Delete(serverURL string) error { ++ if !PassInitialized { ++ return errors.New("pass store is uninitialized") ++ } ++ ++ if serverURL == "" { ++ return errors.New("missing server url") ++ } ++ ++ encoded := base64.URLEncoding.EncodeToString([]byte(serverURL)) ++ _, err := runPass("", "rm", "-rf", path.Join(PASS_FOLDER, encoded)) ++ return err ++} ++ ++// listPassDir lists all the contents of a directory in the password store. ++// Pass uses fancy unicode to emit stuff to stdout, so rather than try ++// and parse this, let's just look at the directory structure instead. ++func listPassDir(args ...string) ([]os.FileInfo, error) { ++ passDir := os.ExpandEnv("$HOME/.password-store") ++ for _, e := range os.Environ() { ++ parts := strings.SplitN(e, "=", 2) ++ if len(parts) < 2 { ++ continue ++ } ++ ++ if parts[0] != "PASSWORD_STORE_DIR" { ++ continue ++ } ++ ++ passDir = parts[1] ++ break ++ } ++ ++ p := path.Join(append([]string{passDir, PASS_FOLDER}, args...)...) ++ contents, err := ioutil.ReadDir(p) ++ if err != nil { ++ if os.IsNotExist(err) { ++ return []os.FileInfo{}, nil ++ } ++ ++ return nil, err ++ } ++ ++ return contents, nil ++} ++ ++// Get returns the username and secret to use for a given registry server URL. ++func (h Pass) Get(serverURL string) (string, string, error) { ++ if !PassInitialized { ++ return "", "", errors.New("pass store is uninitialized") ++ } ++ ++ if serverURL == "" { ++ return "", "", errors.New("missing server url") ++ } ++ ++ encoded := base64.URLEncoding.EncodeToString([]byte(serverURL)) ++ ++ usernames, err := listPassDir(encoded) ++ if err != nil { ++ return "", "", err ++ } ++ ++ if len(usernames) < 1 { ++ return "", "", fmt.Errorf("no usernames for %s", serverURL) ++ } ++ ++ actual := strings.TrimSuffix(usernames[0].Name(), ".gpg") ++ secret, err := runPass("", "show", path.Join(PASS_FOLDER, encoded, actual)) ++ return actual, secret, err ++} ++ ++// List returns the stored URLs and corresponding usernames for a given credentials label ++func (h Pass) List() (map[string]string, error) { ++ if !PassInitialized { ++ return nil, errors.New("pass store is uninitialized") ++ } ++ ++ servers, err := listPassDir() ++ if err != nil { ++ return nil, err ++ } ++ ++ resp := map[string]string{} ++ ++ for _, server := range servers { ++ if !server.IsDir() { ++ continue ++ } ++ ++ serverURL, err := base64.URLEncoding.DecodeString(server.Name()) ++ if err != nil { ++ return nil, err ++ } ++ ++ usernames, err := listPassDir(server.Name()) ++ if err != nil { ++ return nil, err ++ } ++ ++ if len(usernames) < 1 { ++ return nil, fmt.Errorf("no usernames for %s", serverURL) ++ } ++ ++ resp[string(serverURL)] = strings.TrimSuffix(usernames[0].Name(), ".gpg") ++ } ++ ++ return resp, nil ++} Added: head/sysutils/docker/files/patch-components_cli_vendor_github.com_docker_docker_pkg_archive_archive__unix.go ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/docker/files/patch-components_cli_vendor_github.com_docker_docker_pkg_archive_archive__unix.go Wed Jan 3 20:24:18 2018 (r458002) @@ -0,0 +1,11 @@ +--- components/cli/vendor/github.com/docker/docker/pkg/archive/archive_unix.go.orig 2017-12-27 17:03:35 UTC ++++ components/cli/vendor/github.com/docker/docker/pkg/archive/archive_unix.go +@@ -62,7 +62,7 @@ func getInodeFromStat(stat interface{}) (inode uint64, + s, ok := stat.(*syscall.Stat_t) + + if ok { +- inode = s.Ino ++ inode = uint64(s.Ino) + } + + return Added: head/sysutils/docker/files/patch-components_cli_vendor_github.com_docker_docker_pkg_archive_changes__unix.go ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/docker/files/patch-components_cli_vendor_github.com_docker_docker_pkg_archive_changes__unix.go Wed Jan 3 20:24:18 2018 (r458002) @@ -0,0 +1,11 @@ +--- components/cli/vendor/github.com/docker/docker/pkg/archive/changes_unix.go.orig 2017-12-27 17:03:35 UTC ++++ components/cli/vendor/github.com/docker/docker/pkg/archive/changes_unix.go +@@ -29,7 +29,7 @@ func (info *FileInfo) isDir() bool { + } + + func getIno(fi os.FileInfo) uint64 { +- return fi.Sys().(*syscall.Stat_t).Ino ++ return uint64(fi.Sys().(*syscall.Stat_t).Ino) + } + + func hasHardlinks(fi os.FileInfo) bool { Added: head/sysutils/docker/files/patch-components_cli_vendor_github.com_tonistiigi_fsutil_diskwriter__freebsd.go ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/docker/files/patch-components_cli_vendor_github.com_tonistiigi_fsutil_diskwriter__freebsd.go Wed Jan 3 20:24:18 2018 (r458002) @@ -0,0 +1,23 @@ +--- components/cli/vendor/github.com/tonistiigi/fsutil/diskwriter_freebsd.go.orig 2018-01-03 19:54:52 UTC ++++ components/cli/vendor/github.com/tonistiigi/fsutil/diskwriter_freebsd.go +@@ -0,0 +1,20 @@ ++// +build freebsd ++ ++package fsutil ++ ++import ( ++ "github.com/pkg/errors" ++ "golang.org/x/sys/unix" ++) ++ ++func chtimes(path string, un int64) error { ++ var utimes [2]unix.Timespec ++ utimes[0] = unix.NsecToTimespec(un) ++ utimes[1] = utimes[0] ++ ++ if err := unix.UtimesNanoAt(unix.AT_FDCWD, path, utimes[0:], unix.AT_SYMLINK_NOFOLLOW); err != nil { ++ return errors.Wrap(err, "failed call to UtimesNanoAt") ++ } ++ ++ return nil ++} Added: head/sysutils/docker/files/patch-components_cli_vendor_github.com_tonistiigi_fsutil_walker__unix.go ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/docker/files/patch-components_cli_vendor_github.com_tonistiigi_fsutil_walker__unix.go Wed Jan 3 20:24:18 2018 (r458002) @@ -0,0 +1,11 @@ +--- components/cli/vendor/github.com/tonistiigi/fsutil/walker_unix.go.orig 2018-01-03 19:53:04 UTC ++++ components/cli/vendor/github.com/tonistiigi/fsutil/walker_unix.go +@@ -41,7 +41,7 @@ func setUnixOpt(fi os.FileInfo, stat *Stat, path strin + stat.Devminor = int64(minor(uint64(s.Rdev))) + } + +- ino := s.Ino ++ ino := uint64(s.Ino) + if s.Nlink > 1 { + if oldpath, ok := seenFiles[ino]; ok { + stat.Linkname = oldpath