summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2017-04-27 08:51:00 +0000
committerNorbert Preining <preining@logic.at>2017-04-27 08:51:00 +0000
commit9a7bf691299063f68cde150ae981f28b12b156ae (patch)
tree33c333d2c758c0429a42926349dfd861081d2af9 /Master/texmf-dist
parent6fd3481f51617c4fdd014a6784cc6b2d5fcce5c7 (diff)
tlmgr conf texmf auxtrees [add|remove|show] addition
git-svn-id: svn://tug.org/texlive/trunk@44076 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rwxr-xr-xMaster/texmf-dist/scripts/texlive/tlmgr.pl102
1 files changed, 98 insertions, 4 deletions
diff --git a/Master/texmf-dist/scripts/texlive/tlmgr.pl b/Master/texmf-dist/scripts/texlive/tlmgr.pl
index 042348e8438..dca8716a0c8 100755
--- a/Master/texmf-dist/scripts/texlive/tlmgr.pl
+++ b/Master/texmf-dist/scripts/texlive/tlmgr.pl
@@ -5513,7 +5513,7 @@ sub action_conf {
} elsif ($arg !~ /^(tlmgr|texmf|updmap)$/) {
warn "$prg: unknown conf arg: $arg (try tlmgr or texmf or updmap)\n";
- $ret = $F_ERROR;
+ return($F_ERROR);
} else {
my ($fn,$cf);
@@ -5533,7 +5533,7 @@ sub action_conf {
} else {
die "Should not happen, conf arg=$arg";
}
- my ($key,$val) = @ARGV;
+ my ($key,$val,$str) = @ARGV;
if (!defined($key)) {
# show all settings
if ($cf) {
@@ -5543,10 +5543,97 @@ sub action_conf {
}
} else {
info("$arg config file $fn not present\n");
- $ret = $F_WARNING;
+ return($F_WARNING);
}
} else {
- if (!defined($val)) {
+ if ($key eq "auxtrees") {
+ if ($arg eq "texmf") {
+ my $tmfa = 'TEXMFAUXTREES';
+ my $tv = $cf->value($tmfa);
+ if ($val 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 "No auxilary 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) {
+ print "Already registered auxtree: $str\n";
+ return ($F_WARNING);
+ } else {
+ push @new, $f;
+ }
+ }
+ push @new, $str;
+ $cf->value($tmfa, '{' . join(',', @new) . ',}');
+ } else {
+ $cf->value($tmfa, '{' . $str . ',}');
+ }
+ } else {
+ warning("argument missing for auxtrees add\n");
+ return($F_ERROR);
+ }
+ } 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;
+ }
+ }
+ if ($removed) {
+ if ($#new >= 0) {
+ $cf->value($tmfa, '{' . join(',', @new) . ',}');
+ } else {
+ $cf->delete_key($tmfa);
+ }
+ } else {
+ print ("argument `$str' not defined as auxilary texmf tree\n");
+ return($F_WARNING);
+ }
+ } else {
+ print "No auxilary texmf trees defined, nothing removed\n";
+ return($F_WARNING);
+ }
+ } else {
+ warning("argument missing for auxtrees remove\n");
+ return($F_ERROR);
+ }
+ } else {
+ warning("unknown operation on auxtrees: $val\n");
+ return($F_ERROR);
+ }
+ } else {
+ warning("auxtrees not suitable for $arg\n");
+ return($F_ERROR);
+ }
+ } elsif (!defined($val)) {
if (defined($opts{'delete'})) {
if (defined($cf->value($key))) {
info("removing setting $arg $key value: " . $cf->value($key) . "from $fn\n");
@@ -5586,6 +5673,7 @@ sub action_conf {
$cf->save;
}
}
+ return($ret);
}
# output various values in same form as texconfig conf.
@@ -7026,6 +7114,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>]
With only C<conf>, show general configuration information for TeX Live,
including active configuration files, path settings, and more. This is
@@ -7045,6 +7134,11 @@ out).
If I<value> is given in addition, I<key> is set to I<value> in the
respective file. I<No error checking is done!>
+For C<texmf> there is a special key C<auxtrees> which allows adding
+and removing auxilary texmf trees. C<auxtrees show> shows the list
+of additional trees, C<texmf add> I<tree> adds a tree to the list,
+and C<auxtrees remove> I<tree> removes a tree from the list (if present).
+
In all cases the file used can be explicitly specified via the option
C<--conffile I<file>>, in case one wants to operate on a different file.