From 62b9d78b189422d970e3ee4706904664be32ff98 Mon Sep 17 00:00:00 2001 From: Michael Weiss Date: Sat, 16 Sep 2017 17:57:14 +0200 Subject: [PATCH] fetchRepoProject: Fix the GnuPG verification The verification was failing with the following error: gpg: keyblock resource '/tmp/nix-build-XYZ.drv-0/.repo/repo/./.repoconfig/gnupg/pubring.kbx': No such file or directory Using an absolute path for $HOME fixes this. And since 175ecbab9163fa6d5dc7481c6258301833e02042 the dependencies on "git" and "gnupg" aren't required anymore as "gitRepo" already covers them. --- pkgs/build-support/fetchrepoproject/default.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkgs/build-support/fetchrepoproject/default.nix b/pkgs/build-support/fetchrepoproject/default.nix index 81f7b3d3f56..b16552be310 100644 --- a/pkgs/build-support/fetchrepoproject/default.nix +++ b/pkgs/build-support/fetchrepoproject/default.nix @@ -1,4 +1,4 @@ -{ stdenv, git, gitRepo, gnupg ? null, cacert, copyPathsToStore }: +{ stdenv, gitRepo, cacert, copyPathsToStore }: { name, manifest, rev ? "HEAD", sha256 , repoRepoURL ? "", repoRepoRev ? "", referenceDir ? "" @@ -45,11 +45,14 @@ in stdenv.mkDerivation { "GIT_PROXY_COMMAND" "SOCKS_SERVER" ]; - buildInputs = [ git gitRepo cacert ] ++ optional (gnupg != null) [ gnupg ]; + buildInputs = [ gitRepo cacert ]; GIT_SSL_CAINFO = "${cacert}/etc/ssl/certs/ca-bundle.crt"; buildCommand = '' + # Path must be absolute (e.g. for GnuPG: ~/.repoconfig/gnupg/pubring.kbx) + export HOME="$(pwd)" + mkdir .repo ${optionalString (local_manifests != []) '' mkdir .repo/local_manifests @@ -58,7 +61,6 @@ in stdenv.mkDerivation { done ''} - export HOME=.repo repo init ${concatStringsSep " " repoInitFlags} repo sync --jobs=$NIX_BUILD_CORES --current-branch ${optionalString (!createMirror) "rm -rf $out/.repo"}