summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-04-18 22:23:44 +0000
committerKarl Berry <karl@freefriends.org>2016-04-18 22:23:44 +0000
commit81794ddb2a32c45772a8826df77aefd0715c2efd (patch)
tree15e1db3a871dcff8b1c34e3ad27646e8080710df
parent182f384a817a982e1f078a496b68cae8edacb777 (diff)
TLUtils.pm (setup_gpg): if the envvar is set, don't look for anything else.
tlmgr.pl (main): die if --verify-downloads and no gpg; only log if no gpg and only requested in config. git-svn-id: svn://tug.org/texlive/trunk@40601 c570f23f-e606-0410-a88d-b1316a301751
-rwxr-xr-xMaster/texmf-dist/scripts/texlive/tlmgr.pl12
-rw-r--r--Master/tlpkg/TeXLive/TLUtils.pm43
2 files changed, 32 insertions, 23 deletions
diff --git a/Master/texmf-dist/scripts/texlive/tlmgr.pl b/Master/texmf-dist/scripts/texlive/tlmgr.pl
index 6861341ba1a..e7060a3d1fa 100755
--- a/Master/texmf-dist/scripts/texlive/tlmgr.pl
+++ b/Master/texmf-dist/scripts/texlive/tlmgr.pl
@@ -622,7 +622,6 @@ for the full story.\n";
}
}
- #
# setup gpg if available
# first line: --(no-)verify-downloads was passed in (opts defined)
# second line: not passed in but in config
@@ -630,13 +629,18 @@ for the full story.\n";
||
(!defined($opts{"verify-downloads"}) && $config{"verify-downloads"})) {
if (TeXLive::TLUtils::setup_gpg($Master)) {
- log("Trying to verify cryptographic signatures!\n")
+ log("will verify cryptographic signatures\n")
} else {
- tlwarn("Couldn't detect gpg so will proceed without verification!\n");
+ my $prefix = "$prg: No gpg found"; # just to shorten the strings
+ if ($opts{"verify-downloads"}) {
+ tldie ("$prefix, verification explicitly requested, quitting.\n");
+ } else {
+ log ("$prefix, verification implicitly requested, "
+ . "continuing without verification\n");
+ }
}
}
-
my $ret = execute_action($action, @ARGV);
# F_ERROR stops processing immediately, and prevents postactions from
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm
index bfdb55d1087..2db7533b0c1 100644
--- a/Master/tlpkg/TeXLive/TLUtils.pm
+++ b/Master/tlpkg/TeXLive/TLUtils.pm
@@ -3643,13 +3643,14 @@ sub tlchecksum_data {
=item C<< setup_gpg() >>
-Tries to set up gpg command line C<$::gpg> used for
-verification of downloads. Checks first for the environment variable
-C<TEXLIVE_GNUPG>, then for C<gpg>, and finally for C<gpg2>.
-Further adaption of the invocation of C<gpg> can be done using the
-two enviroment variables C<TL_GNUPGHOME>, which is passed to
-C<gpg> with C<--homedir>, and C<TL_GNUPGARGS>, which replaces the
-default arguments C<--no-secmem-warning --no-permission-warning>.
+Tries to set up gpg command line C<$::gpg> used for verification of
+downloads. Checks for the environment variable C<TL_GNUPG>; if that
+envvar is not set, first C<gpg>, then C<gpg2>, then, on Windows only,
+C<tlpkg/installer/gpg/gpg.exe> is looked for. Further adaptation of the
+invocation of C<gpg> can be done using the two enviroment variables
+C<TL_GNUPGHOME>, which is passed to C<gpg> with C<--homedir>, and
+C<TL_GNUPGARGS>, which replaces the default arguments
+C<--no-secmem-warning --no-permission-warning>.
Returns 1/0 on success/failure.
@@ -3686,25 +3687,29 @@ sub setup_gpg {
my $found = 0;
my $prg;
if ($ENV{'TL_GNUPG'}) {
+ # if envvar is set, don't look for anything else.
$prg = test_one_gpg($ENV{'TL_GNUPG'});
$found = 1 if ($prg);
- }
- if (!$found) {
+ } else {
+ # no envvar, look for gpg
$prg = test_one_gpg('gpg');
$found = 1 if ($prg);
- }
- if (!$found) {
- $prg = test_one_gpg('gpg2');
- $found = 1 if ($prg);
- }
- if (!$found && $^O =~ /^MSWin/i) {
- # test on windows also a shipped version from texlive.gpg.win32
- if (-r "$master/tlpkg/installer/gpg/gpg.exe") {
- $prg = "$master/tlpkg/installer/gpg/gpg.exe";
- $found = 1;
+
+ # no gpg, look for gpg2
+ if (!$found) {
+ $prg = test_one_gpg('gpg2');
+ $found = 1 if ($prg);
+ }
+ if (!$found && $^O =~ /^MSWin/i) {
+ # test on windows also a shipped version from texlive.gpg.win32
+ if (-r "$master/tlpkg/installer/gpg/gpg.exe") {
+ $prg = "$master/tlpkg/installer/gpg/gpg.exe";
+ $found = 1;
+ }
}
}
return 0 if (!$found);
+
# ok, we found one
# Set up the gpg invocation:
$::gpg = "$prg ";