summaryrefslogtreecommitdiff
path: root/Master/tlpkg/TeXLive/TLUtils.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/TeXLive/TLUtils.pm')
-rw-r--r--Master/tlpkg/TeXLive/TLUtils.pm21
1 files changed, 14 insertions, 7 deletions
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm
index 715517f57f7..dcc3309f333 100644
--- a/Master/tlpkg/TeXLive/TLUtils.pm
+++ b/Master/tlpkg/TeXLive/TLUtils.pm
@@ -3638,12 +3638,12 @@ sub setup_gpg {
# ok, we found one
# Set up the gpg invocation:
$::gpg = "$::progs{'gpg'} ";
- if ($ENV{'TL_GNUPGHOME'}) {
- # the user wants us to use this directory, sure, do it
- $::gpg .= "--homedir $ENV{'TL_GNUPGHOME'} ";
- } else {
- $::gpg .= "--homedir $master/tlpkg/gpg ";
- }
+ my $gpghome = ($ENV{'TL_GNUPGHOME'} ? $ENV{'TL_GNUPGHOME'} :
+ "$master/tlpkg/gpg" );
+ $gpghome =~ s!/!\\!g if win32();
+ my $gpghome_quote = "\"$gpghome\"";
+ # mind the final space for following args
+ $::gpg .= "--homedir $gpghome_quote ";
if ($ENV{'TL_GNUPGARGS'}) {
$::gpg .= $ENV{'TL_GNUPGARGS'};
} else {
@@ -3783,7 +3783,14 @@ GPGERROR
sub gpg_verify_signature {
my ($file, $sig) = @_;
- my ($out, $ret) = run_cmd("$::gpg --verify $sig $file 2>&1");
+ my ($file_quote, $sig_quote);
+ if (win32()) {
+ $file =~ s!/!\\!g;
+ $sig =~ s!/!\\!g;
+ }
+ $file_quote = "\"$file\"";
+ $sig_quote = "\"$sig\"";
+ my ($out, $ret) = run_cmd("$::gpg --verify $sig_quote $file_quote 2>&1");
if ($ret == 0) {
debug("verification succeeded, output:\n$out\n");
return 1;