Skip to content

Commit

Permalink
tests/hetzner/repos: Pin GnuPG version to v2.0
Browse files Browse the repository at this point in the history
I ran into this while trying to run tests prior to merging #564 (merge
commit b09e618).

The default GnuPG version in <nixpkgs> is 2.1, but the Debian version
used while building the Debian repository is GnuPG version 2.0, so we
need to make sure both versions match at least in major and minor.

The test for the Hetzner backend now still fails, but at least it
doesn't fail anymore because one of its dependencies are failing.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
  • Loading branch information
aszlig committed Jan 2, 2017
1 parent 9c3aecb commit a29d334
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions tests/hetzner-backend/repository.nix
Expand Up @@ -3,6 +3,9 @@
}:

let
# Has to match with the version used in the Debian repository.
gnupg = pkgs.gnupg20;

reprepro = pkgs.stdenv.mkDerivation rec {
name = "reprepro-${version}";
version = "4.16.0";
Expand All @@ -13,10 +16,12 @@ let
sha256 = "14gmk16k9n04xda4446ydfj8cr5pmzsmm4il8ysf69ivybiwmlpx";
};

buildInputs = with pkgs; [ makeWrapper db gpgme libarchive bzip2 xz zlib ];
nativeBuildInputs = [ pkgs.makeWrapper ];
buildInputs = pkgs.lib.singleton (pkgs.gpgme.override { inherit gnupg; })
++ (with pkgs; [ db libarchive bzip2 xz zlib ]);

postInstall = ''
wrapProgram "$out/bin/reprepro" --prefix PATH : "${pkgs.gnupg}/bin"
wrapProgram "$out/bin/reprepro" --prefix PATH : "${gnupg}/bin"
'';
};

Expand Down Expand Up @@ -45,13 +50,13 @@ let
%echo Repository key created
EOF
${pkgs.gnupg}/bin/gpg2 --batch --gen-key template
${gnupg}/bin/gpg2 --batch --gen-key template
${pkgs.gnupg}/bin/gpg2 --list-secret-keys --with-colons | \
${gnupg}/bin/gpg2 --list-secret-keys --with-colons | \
grep '^sec:' | cut -d: -f5 > "$secretKeyId"
${pkgs.gnupg}/bin/gpg2 --list-public-keys --with-colons | \
${gnupg}/bin/gpg2 --list-public-keys --with-colons | \
grep '^pub:' | cut -d: -f5 > "$publicKeyId"
${pkgs.gnupg}/bin/gpg2 --export \
${gnupg}/bin/gpg2 --export \
"$(< "$publicKeyId")" \
> "$publicKey"
'';
Expand Down

0 comments on commit a29d334

Please sign in to comment.