Skip to content

Commit

Permalink
fetchRepoProject: Fix the GnuPG verification
Browse files Browse the repository at this point in the history
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 175ecba the dependencies on
"git" and "gnupg" aren't required anymore as "gitRepo" already covers
them.
  • Loading branch information
primeos committed Sep 16, 2017
1 parent 50ce8ab commit 62b9d78
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions 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 ? ""
Expand Down Expand Up @@ -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
Expand All @@ -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"}
Expand Down

0 comments on commit 62b9d78

Please sign in to comment.