summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2016-04-12 06:11:02 +0000
committerNorbert Preining <preining@logic.at>2016-04-12 06:11:02 +0000
commitdfdc5b1702a1a22c2e5003f00931066e24770154 (patch)
tree96e40ec26df78df110e33ff661f0d64329647cd7
parentc9367258a3cd0e44e0d82bb91dd0c33e25443cda (diff)
adjust gpg code to spaces in filenames and win32
git-svn-id: svn://tug.org/texlive/trunk@40447 c570f23f-e606-0410-a88d-b1316a301751
-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;