summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xMaster/texmf-dist/scripts/texlive/tlmgr.pl23
-rw-r--r--Master/tlpkg/TeXLive/TLCrypto.pm12
2 files changed, 19 insertions, 16 deletions
diff --git a/Master/texmf-dist/scripts/texlive/tlmgr.pl b/Master/texmf-dist/scripts/texlive/tlmgr.pl
index 287c45a1a87..eb51bfbe404 100755
--- a/Master/texmf-dist/scripts/texlive/tlmgr.pl
+++ b/Master/texmf-dist/scripts/texlive/tlmgr.pl
@@ -382,9 +382,9 @@ sub main {
$action = shift @ARGV;
if (!defined($action)) {
- if ($opts{"gui"}) { # -gui = gui
+ if ($opts{"gui"}) { # -gui = gui
$action = "gui";
- } elsif ($opts{"print-platform"}) { # -print-arch = print-arch
+ } elsif ($opts{"print-platform"}) { # -print-arch = print-arch
$action = "print-platform";
} else {
$action = "";
@@ -5644,21 +5644,22 @@ sub texconfig_conf_mimic {
sub action_key {
my $arg = shift @ARGV;
- $arg = lc($arg);
if (!defined($arg)) {
tlwarn("missing arguments to action `key'\n");
return $F_ERROR;
+ }
- } elsif ($arg =~ /^(add|delete|list)$/) {
+ $arg = lc($arg);
+ if ($arg =~ /^(add|delete|list)$/) {
handle_gpg_config_settings();
if (!$::gpg) {
tlwarn("gnupg is not found or setup, cannot continue with action `key'\n");
return $F_ERROR;
}
chomp (my $TEXMFSYSCONFIG = `kpsewhich -var-value=TEXMFSYSCONFIG`);
- my $local_keyring = "$TEXMFSYSCONFIG/tlpkg/gpg/keyring.gpg";
+ my $local_keyring = "$Master/tlpkg/gpg/repository-keys.gpg";
if ($arg eq 'list') {
debug("running $::gpg --list-keys\n");
system("$::gpg --list-keys");
@@ -5674,9 +5675,9 @@ sub action_key {
tlwarn("no local keyring available, cannot delete anything!\n");
return $F_ERROR;
}
- debug("running: $::gpg --primary-keyring \"$local_keyring\" --delete-key $what\n");
+ debug("running: $::gpg --primary-keyring repository-keys.gpg --delete-key $what\n");
my ($out, $ret) =
- TeXLive::TLUtils::run_cmd("$::gpg --primary-keyring \"$local_keyring\" --delete-key \"$what\" 2>&1");
+ TeXLive::TLUtils::run_cmd("$::gpg --primary-keyring repository-keys.gpg --delete-key \"$what\" 2>&1");
if ($ret == 0) {
info("key successfully removed\n");
return $F_OK;
@@ -5693,13 +5694,12 @@ sub action_key {
}
# we need to make sure that $local_keyring is existent!
if (! -r $local_keyring) {
- TeXLive::TLUtils::mkdirhier("$TEXMFSYSCONFIG/tlpkg/gpg");
open(FOO, ">$local_keyring") || die("Cannot create $local_keyring: $!");
close(FOO);
}
- debug("running: $::gpg --primary-keyring \"$local_keyring\" --import $what\n");
+ debug("running: $::gpg --primary-keyring repository-keys.gpg --import $what\n");
my ($out, $ret) =
- TeXLive::TLUtils::run_cmd("$::gpg --primary-keyring \"$local_keyring\" --import \"$what\" 2>&1");
+ TeXLive::TLUtils::run_cmd("$::gpg --primary-keyring repository-keys.gpg --import \"$what\" 2>&1");
if ($ret == 0) {
info("key successfully imported\n");
return $F_OK;
@@ -7124,7 +7124,8 @@ With the C<list> argument lists all keys.
The C<add> argument requires another argument, either a filename or
C<-> for stdin, from which the key is added. The key is added to the
-local keyring C<TEXMFSYSCONFIG/tlpkg/gpg/keyring.gpg>.
+local keyring C<GNUPGHOME/repository-keys.gpg>, which normally is
+C<tlpkg/gpg/repository-keys.gpg>.
The C<delete> argument requires a key id and removes the requested id
from the local keyring.
diff --git a/Master/tlpkg/TeXLive/TLCrypto.pm b/Master/tlpkg/TeXLive/TLCrypto.pm
index f604b2b4f39..ed61a663d56 100644
--- a/Master/tlpkg/TeXLive/TLCrypto.pm
+++ b/Master/tlpkg/TeXLive/TLCrypto.pm
@@ -311,13 +311,15 @@ sub setup_gpg {
# mind the final space for following args
$::gpg = "$prg --homedir $gpghome_quote ";
#
- # check for additional keyrings in
- # TEXMFSYSCONFIG/tlpkg/gpg/keyring.gpg
- chomp (my $TEXMFSYSCONFIG = `kpsewhich -var-value=TEXMFSYSCONFIG`);
- my $addkr = "$TEXMFSYSCONFIG/tlpkg/gpg/keyring.gpg";
+ # check for additional keyring
+ # originally we wanted to use TEXMFSYSCONFIG, but gnupg on Windows
+ # is so stupid that it *prepends* GNUPGHOME to paths starting with
+ # a drive letter like c:/
+ # Thus we switch to using repository-keys.gpg in GNUPGHOME!
+ my $addkr = "$gpghome/repository-keys.gpg";
if (-r $addkr) {
debug("setup_gpg: using additional keyring $addkr\n");
- $::gpg .= "--keyring \"$addkr\" ";
+ $::gpg .= "--keyring repository-keys.gpg ";
}
if ($ENV{'TL_GNUPGARGS'}) {
$::gpg .= $ENV{'TL_GNUPGARGS'};