Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

Merge pull request #47977 from charles-dyfis-net/gnupg20-1compat-fix

gnupg1compat: fix compatibility with gnupg20

authored by

Lancelot SIX and committed by
GitHub
20249caf cf474236

+15 -6
+13 -5
pkgs/tools/security/gnupg/1compat.nix
··· 4 4 name = "gnupg1compat-${gnupg.version}"; 5 5 6 6 builder = writeScript "gnupg1compat-builder" '' 7 + PATH=${coreutils}/bin 7 8 # First symlink all top-level dirs 8 - ${coreutils}/bin/mkdir -p $out 9 - ${coreutils}/bin/ln -s "${gnupg}/"* $out 9 + mkdir -p $out 10 + ln -s "${gnupg}/"* $out 10 11 11 12 # Replace bin with directory and symlink it contents 12 - ${coreutils}/bin/rm $out/bin 13 - ${coreutils}/bin/mkdir -p $out/bin 14 - ${coreutils}/bin/ln -s "${gnupg}/bin/"* $out/bin 13 + rm $out/bin 14 + mkdir -p $out/bin 15 + ln -s "${gnupg}/bin/"* $out/bin 16 + 17 + # Add symlinks for any executables that end in 2 and lack any non-*2 version 18 + for f in $out/bin/*2; do 19 + [[ -x $f ]] || continue # ignore failed globs and non-executable files 20 + [[ -e ''${f%2} ]] && continue # ignore commands that already have non-*2 versions 21 + ln -s -- "''${f##*/}" "''${f%2}" 22 + done 15 23 ''; 16 24 17 25 meta = gnupg.meta // {
+2 -1
pkgs/tools/security/gnupg/20.nix
··· 12 12 assert guiSupport -> pinentry != null; 13 13 14 14 stdenv.mkDerivation rec { 15 - name = "gnupg-2.0.30"; 15 + name = "gnupg-${version}"; 16 + version = "2.0.30"; 16 17 17 18 src = fetchurl { 18 19 url = "mirror://gnupg/gnupg/${name}.tar.bz2";