diff options
Diffstat (limited to 'Master')
-rw-r--r-- | Master/tlpkg/TeXLive/TLUtils.pm | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm index 60c6e814d64..9dd9a42df76 100644 --- a/Master/tlpkg/TeXLive/TLUtils.pm +++ b/Master/tlpkg/TeXLive/TLUtils.pm @@ -3642,11 +3642,25 @@ Returns 1/0 on success/failure. sub setup_gpg { my $master = shift; if ($^O =~ /^MSWin(32|64)$/i) { - $::progs{'gpg'} = conv_to_w32_path("$master/tlpkg/installer/gpg/gpg.exe"); - my $ret = system("$::progs{'gpg'} --version >nul 2>&1"); # on windows - if ($ret != 0) { - return 0; + my $sysgpg = which('gpg'); + my $found = 0; + if ($sysgpg) { + # test whether it actually works + my $ret = system("gpg --version >nul 2>&1"); + if ($ret == 0) { + $found = 1; + $::progs{'gpg'} = $sysgpg; + } + } + if (!$found) { + my $tlgpg = conv_to_w32_path("$master/tlpkg/installer/gpg/gpg.exe"); + my $ret = system("$tlgpg --version >nul 2>&1"); # on windows + if ($ret == 0) { + $::progs{'gpg'} = $tlgpg; + $found = 1; + } } + return 0 if (!$found); } else { # first search for a gpg binary return 0 if (!setup_unix_one( 'gpg' , '/no/such/path', '--version', 1)); |