gpg1: gpgkeys_* are called without the suffix

The gpg1 binary has the libexec/"gnupg" directory hard-coded and calls
those binaries without the suffix. Adding the symbolic links to the
binaries that were installed with the suffix for the names gpg1 uses
allows gpg1 to fetch keys from a key server.

Without those links it will just complain that gpgkeys_curl doesn't
exist in that directory (or similar for gpgkeys_hkp too).

Closes #30542.
Closes #28249.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
This commit is contained in:
tcely 2018-05-25 01:08:30 -04:00 committed by Dominyk Tiller
parent b86961b669
commit 8319ffd314
No known key found for this signature in database
GPG key ID: FE19AEFCF658C6F6

View file

@ -4,6 +4,7 @@ class GnupgAT14 < Formula
url "https://gnupg.org/ftp/gcrypt/gnupg/gnupg-1.4.23.tar.bz2"
mirror "https://www.mirrorservice.org/sites/ftp.gnupg.org/gcrypt/gnupg/gnupg-1.4.23.tar.bz2"
sha256 "c9462f17e651b6507848c08c430c791287cd75491f8b5a8b50c6ed46b12678ba"
revision 1
bottle do
sha256 "06712329d11b029b7e1fcc0064d72865caa5e65c93fb39ccababc67320991f8c" => :high_sierra
@ -36,10 +37,17 @@ class GnupgAT14 < Formula
# https://lists.gnupg.org/pipermail/gnupg-devel/2016-August/031533.html
inreplace bin/"gpg-zip1", "GPG=gpg", "GPG=gpg1"
# link to libexec binaries without the "1" suffix
# gpg1 will call them without the suffix when it needs to
%w[curl finger hkp ldap].each do |cmd|
cmd.prepend("gpgkeys_")
(libexec/"gnupg").install_symlink (cmd + "1") => cmd
end
# Although gpg2 support should be pretty universal these days
# keep vanilla `gpg` executables available, at least for now.
%w[gpg-zip1 gpg1 gpgsplit1 gpgv1].each do |cmd|
(libexec/"gpgbin").install_symlink bin/cmd => cmd.to_s.sub(/1/, "")
%w[gpg-zip gpg gpgsplit gpgv].each do |cmd|
(libexec/"gpgbin").install_symlink bin/(cmd + "1") => cmd
end
end