diff options
author | Norbert Preining <preining@logic.at> | 2017-05-04 07:21:23 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2017-05-04 07:21:23 +0000 |
commit | 188f2ea267bd8d3aa930d76181a3693386440656 (patch) | |
tree | d5b470f5db40c805391901f6b3517125331d4e6a /Master/texmf-dist/scripts | |
parent | 077ced00a90335f1816cf4e5be23f66a8f057263 (diff) |
tlmgr conf texmf auxtrees => tlmgr conf auxtrees
git-svn-id: svn://tug.org/texlive/trunk@44186 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts')
-rwxr-xr-x | Master/texmf-dist/scripts/texlive/tlmgr.pl | 151 |
1 files changed, 75 insertions, 76 deletions
diff --git a/Master/texmf-dist/scripts/texlive/tlmgr.pl b/Master/texmf-dist/scripts/texlive/tlmgr.pl index 0153c85c44e..6ad1ccde64e 100755 --- a/Master/texmf-dist/scripts/texlive/tlmgr.pl +++ b/Master/texmf-dist/scripts/texlive/tlmgr.pl @@ -5519,8 +5519,8 @@ sub action_conf { if (!defined($arg)) { texconfig_conf_mimic(); - } elsif ($arg !~ /^(tlmgr|texmf|updmap)$/) { - warn "$prg: unknown conf arg: $arg (try tlmgr or texmf or updmap)\n"; + } elsif ($arg !~ /^(tlmgr|texmf|updmap|auxtrees)$/) { + warn "$prg: unknown conf arg: $arg (try tlmgr or texmf or updmap or auxtrees)\n"; return($F_ERROR); } else { @@ -5532,7 +5532,7 @@ sub action_conf { chomp (my $TEXMFCONFIG = `kpsewhich -var-value=TEXMFCONFIG`); $fn || ( $fn = "$TEXMFCONFIG/tlmgr/config" ) ; $cf = TeXLive::TLConfFile->new($fn, "#", "="); - } elsif ($arg eq "texmf") { + } elsif ($arg eq "texmf" || $arg eq "auxtrees") { $fn || ( $fn = "$Master/texmf.cnf" ) ; $cf = TeXLive::TLConfFile->new($fn, "[%#]", "="); } elsif ($arg eq "updmap") { @@ -5541,9 +5541,13 @@ sub action_conf { } else { die "Should not happen, conf arg=$arg"; } - my ($key,$val,$str) = @ARGV; + my ($key,$val) = @ARGV; + # make sure that in case of tlmgr conf auxtrees (without anything else) + # we add the "show" argument which makes it easier to do stuff. + $key = "show" if ($arg eq "auxtrees" && !defined($key)); + if (!defined($key)) { - # show all settings + # show all settings (not auxtrees case!) if ($cf) { info("$arg configuration values (from $fn):\n"); for my $k ($cf->keys) { @@ -5554,92 +5558,87 @@ sub action_conf { return($F_WARNING); } } else { - if ($key eq "auxtrees") { - if ($arg eq "texmf") { - my $tmfa = 'TEXMFAUXTREES'; - my $tv = $cf->value($tmfa); - if (!$val || $val eq "show") { + if ($arg eq "auxtrees") { + my $tmfa = 'TEXMFAUXTREES'; + my $tv = $cf->value($tmfa); + if (!$key || $key eq "show") { + if (defined($tv)) { + $tv =~ s/^\s*//; + $tv =~ s/\s*$//; + $tv =~ s/,$//; + my @foo = split(',', $tv); + print "List of auxiliary texmf trees:\n" if (@foo); + for my $f (@foo) { + print " $f\n"; + } + return($F_OK); + } else { + print "$prg: no auxiliary texmf trees defined.\n"; + return($F_OK); + } + } elsif ($key eq "add") { + if (defined($val)) { if (defined($tv)) { $tv =~ s/^\s*//; $tv =~ s/\s*$//; $tv =~ s/,$//; my @foo = split(',', $tv); - print "List of auxiliary texmf trees:\n" if (@foo); + my @new; + my $already = 0; for my $f (@foo) { - print " $f\n"; - } - return($F_OK); - } else { - print "$prg: no auxiliary texmf trees defined.\n"; - return($F_OK); - } - } elsif ($val eq "add") { - if (defined($str)) { - if (defined($tv)) { - $tv =~ s/^\s*//; - $tv =~ s/\s*$//; - $tv =~ s/,$//; - my @foo = split(',', $tv); - my @new; - my $already = 0; - for my $f (@foo) { - if ($f eq $str) { - tlwarn("$prg: already registered auxtree: $str\n"); - return ($F_WARNING); - } else { - push @new, $f; - } + if ($f eq $val) { + tlwarn("$prg: already registered auxtree: $val\n"); + return ($F_WARNING); + } else { + push @new, $f; } - push @new, $str; - $cf->value($tmfa, join(',', @new) . ','); - } else { - $cf->value($tmfa, $str . ','); } + push @new, $val; + $cf->value($tmfa, join(',', @new) . ','); } else { - tlwarn("$prg: missing argument for auxtrees add\n"); - return($F_ERROR); + $cf->value($tmfa, $val . ','); } - } elsif ($val eq "remove") { - if (defined($str)) { - if (defined($tv)) { - $tv =~ s/^\s*//; - $tv =~ s/\s*$//; - $tv =~ s/,$//; - my @foo = split(',', $tv); - my @new; - my $removed = 0; - for my $f (@foo) { - if ($f ne $str) { - push @new, $f; - } else { - $removed = 1; - } + } else { + tlwarn("$prg: missing argument for auxtrees add\n"); + return($F_ERROR); + } + } elsif ($key eq "remove") { + if (defined($val)) { + if (defined($tv)) { + $tv =~ s/^\s*//; + $tv =~ s/\s*$//; + $tv =~ s/,$//; + my @foo = split(',', $tv); + my @new; + my $removed = 0; + for my $f (@foo) { + if ($f ne $val) { + push @new, $f; + } else { + $removed = 1; } - if ($removed) { - if ($#new >= 0) { - $cf->value($tmfa, join(',', @new) . ','); - } else { - $cf->delete_key($tmfa); - } + } + if ($removed) { + if ($#new >= 0) { + $cf->value($tmfa, join(',', @new) . ','); } else { - tlwarn("$prg: not defined as auxiliary texmf tree: $str\n"); - return($F_WARNING); + $cf->delete_key($tmfa); } } else { - tlwarn("$prg: no auxiliary texmf trees defined, " - . "so nothing removed\n"); + tlwarn("$prg: not defined as auxiliary texmf tree: $val\n"); return($F_WARNING); } } else { - tlwarn("$prg: missing argument for auxtrees remove\n"); - return($F_ERROR); + tlwarn("$prg: no auxiliary texmf trees defined, " + . "so nothing removed\n"); + return($F_WARNING); } } else { - tlwarn("$prg: unknown auxtrees operation: $val\n"); + tlwarn("$prg: missing argument for auxtrees remove\n"); return($F_ERROR); } } else { - tlwarn("$prg: auxtrees not suitable for $arg\n"); + tlwarn("$prg: unknown auxtrees operation: $key\n"); return($F_ERROR); } } elsif (!defined($val)) { @@ -7134,7 +7133,7 @@ checking the TL development repository. =back =head2 conf [texmf|tlmgr|updmap [--conffile I<file>] [--delete] [I<key> [I<value>]]] -=head2 conf texmf [--conffile I<file>] auxtrees [show|add|delete] [I<value>] +=head2 conf auxtrees [--conffile I<file>] [show|add|delete] [I<value>] With only C<conf>, show general configuration information for TeX Live, including active configuration files, path settings, and more. This is @@ -7159,16 +7158,16 @@ enabled during installation, you can disable it afterwards: tlmgr conf texmf shell_escape 0 -For C<texmf>, an additional subcommand C<auxtrees> allows adding and +The sub-command C<auxtrees> allows adding and removing arbitrary additional texmf trees, completely under user -control. C<texmf auxtrees show> shows the list of additional trees, -C<texmf auxtrees add> I<tree> adds a tree to the list, and C<texmf -auxtrees remove> I<tree> removes a tree from the list (if present). The +control. C<auxtrees show> shows the list of additional trees, +C<auxtrees add> I<tree> adds a tree to the list, and +C<auxtrees remove> I<tree> removes a tree from the list (if present). The trees should not contain an C<ls-R> file. This works by manipulating the Kpathsea variable C<TEXMFAUXTREES>, in C<ROOT/texmf.cnf>. Example: - tlmgr conf texmf auxtrees add /quick/test/tree - tlmgr conf texmf auxtrees remove /quick/test/tree + tlmgr conf auxtrees add /quick/test/tree + tlmgr conf auxtrees remove /quick/test/tree In all cases the configuration file can be explicitly specified via the option C<--conffile> I<file>, if desired. |