From 08ccf9e0595147c03a37de6529008b95f839cac9 Mon Sep 17 00:00:00 2001 From: Christian Albrecht Date: Wed, 28 Jun 2017 18:38:05 +0200 Subject: [PATCH 1/3] skopeo: 0.1.18 -> 0.1.22 --- pkgs/development/tools/skopeo/default.nix | 8 ++++---- pkgs/development/tools/skopeo/path.patch | 25 +++++++++++------------ 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/pkgs/development/tools/skopeo/default.nix b/pkgs/development/tools/skopeo/default.nix index d1ea6a2e12b..f9c5ee1b7b9 100644 --- a/pkgs/development/tools/skopeo/default.nix +++ b/pkgs/development/tools/skopeo/default.nix @@ -1,22 +1,22 @@ -{ stdenv, lib, buildGoPackage, fetchFromGitHub, gpgme, libgpgerror, devicemapper, btrfs-progs }: +{ stdenv, lib, buildGoPackage, fetchFromGitHub, gpgme, libgpgerror, devicemapper, btrfs-progs, pkgconfig, ostree }: with stdenv.lib; buildGoPackage rec { name = "skopeo-${version}"; - version = "0.1.18"; + version = "0.1.22"; rev = "v${version}"; goPackagePath = "github.com/projectatomic/skopeo"; excludedPackages = "integration"; - buildInputs = [ gpgme libgpgerror devicemapper btrfs-progs ]; + buildInputs = [ gpgme libgpgerror devicemapper btrfs-progs pkgconfig ostree ]; src = fetchFromGitHub { inherit rev; owner = "projectatomic"; repo = "skopeo"; - sha256 = "13k29i5hx909hvddl2xkyw4qzxq2q20ay9bkal3xi063s6l0sh0z"; + sha256 = "0aivs37bcvx3g22a9r3q1vj2ahw323g1vaq9jzbmifm9k0pb07jy"; }; patches = [ diff --git a/pkgs/development/tools/skopeo/path.patch b/pkgs/development/tools/skopeo/path.patch index deb63b27945..22a74ac944b 100644 --- a/pkgs/development/tools/skopeo/path.patch +++ b/pkgs/development/tools/skopeo/path.patch @@ -1,25 +1,24 @@ diff --git a/cmd/skopeo/main.go b/cmd/skopeo/main.go -index 51f918d..6681d73 100644 +index 50e29b2..7108df5 100644 --- a/cmd/skopeo/main.go +++ b/cmd/skopeo/main.go @@ -3,6 +3,7 @@ package main import ( "fmt" "os" -+ "path/filepath" - ++ "path/filepath" + "github.com/Sirupsen/logrus" "github.com/containers/image/signature" -@@ -84,6 +85,12 @@ func getPolicyContext(c *cli.Context) (*signature.PolicyContext, error) { +@@ -88,6 +89,11 @@ func getPolicyContext(c *cli.Context) (*signature.PolicyContext, error) { policyPath := c.GlobalString("policy") var policy *signature.Policy // This could be cached across calls, if we had an application context. var err error -+ var dir string -+ if policyPath == "" { -+ dir, err = filepath.Abs(filepath.Dir(os.Args[0])) -+ policyPath = dir + "/../etc/default-policy.json" -+ } -+ - if policyPath == "" { - policy, err = signature.DefaultPolicy(nil) - } else { ++ var dir string ++ if policyPath == "" { ++ dir, err = filepath.Abs(filepath.Dir(os.Args[0])) ++ policyPath = dir + "/../etc/default-policy.json" ++ } + if c.GlobalBool("insecure-policy") { + policy = &signature.Policy{Default: []signature.PolicyRequirement{signature.NewPRInsecureAcceptAnything()}} + } else if policyPath == "" { From 05e9c47dc3c164417803ec9c769043da7575d5f5 Mon Sep 17 00:00:00 2001 From: Christian Albrecht Date: Thu, 29 Jun 2017 08:47:08 +0200 Subject: [PATCH 2/3] skopeo: 0.1.18 -> 0.1.22 fix certs.d permission error the dependency docker_client.go tries to read /etc/docker/certs.d/ and fails if this is not readable. the original code silently ignores this directory if it is not present so path.patch adds the logic to ignore it in case of a permission error. --- pkgs/development/tools/skopeo/path.patch | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pkgs/development/tools/skopeo/path.patch b/pkgs/development/tools/skopeo/path.patch index 22a74ac944b..35dec5aecbf 100644 --- a/pkgs/development/tools/skopeo/path.patch +++ b/pkgs/development/tools/skopeo/path.patch @@ -22,3 +22,17 @@ index 50e29b2..7108df5 100644 if c.GlobalBool("insecure-policy") { policy = &signature.Policy{Default: []signature.PolicyRequirement{signature.NewPRInsecureAcceptAnything()}} } else if policyPath == "" { +diff --git a/vendor/github.com/containers/image/docker/docker_client.go b/vendor/github.com/containers/image/docker/docker_client.go +index b989770..697d2ee 100644 +--- a/vendor/github.com/containers/image/docker/docker_client.go ++++ b/vendor/github.com/containers/image/docker/docker_client.go +@@ -154,6 +154,9 @@ func setupCertificates(dir string, tlsc *tls.Config) error { + if os.IsNotExist(err) { + return nil + } ++ if os.IsPermission(err) { ++ return nil ++ } + return err + } + From dd484418a194c46a861dae83cfd59671154dd1e2 Mon Sep 17 00:00:00 2001 From: Christian Albrecht Date: Thu, 29 Jun 2017 08:54:52 +0200 Subject: [PATCH 3/3] skopeo: 0.1.18 -> 0.1.22 fix whitespace --- pkgs/development/tools/skopeo/path.patch | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/development/tools/skopeo/path.patch b/pkgs/development/tools/skopeo/path.patch index 35dec5aecbf..eb3c54ae66c 100644 --- a/pkgs/development/tools/skopeo/path.patch +++ b/pkgs/development/tools/skopeo/path.patch @@ -6,7 +6,7 @@ index 50e29b2..7108df5 100644 import ( "fmt" "os" -+ "path/filepath" ++ "path/filepath" "github.com/Sirupsen/logrus" "github.com/containers/image/signature" @@ -14,11 +14,11 @@ index 50e29b2..7108df5 100644 policyPath := c.GlobalString("policy") var policy *signature.Policy // This could be cached across calls, if we had an application context. var err error -+ var dir string -+ if policyPath == "" { -+ dir, err = filepath.Abs(filepath.Dir(os.Args[0])) -+ policyPath = dir + "/../etc/default-policy.json" -+ } ++ var dir string ++ if policyPath == "" { ++ dir, err = filepath.Abs(filepath.Dir(os.Args[0])) ++ policyPath = dir + "/../etc/default-policy.json" ++ } if c.GlobalBool("insecure-policy") { policy = &signature.Policy{Default: []signature.PolicyRequirement{signature.NewPRInsecureAcceptAnything()}} } else if policyPath == "" {