diff options
author | Norbert Preining <preining@logic.at> | 2009-05-05 15:52:39 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2009-05-05 15:52:39 +0000 |
commit | 55345a3b643b440dcf96789675a34ecdb25571d4 (patch) | |
tree | 5a87e13114cde0704ba02ea982a521e8e06cb0e8 | |
parent | 30741871850b08bbd7eaee129e682b824630ff5f (diff) |
tlmgr option autobackup:
- warn if value is out of supported range
- support using "infty" instead of -1 to trick GetOpt parser
- document problem with -1 parsing as option and suggest -- or infty
git-svn-id: svn://tug.org/texlive/trunk@12935 c570f23f-e606-0410-a88d-b1316a301751
-rwxr-xr-x | Master/texmf/scripts/texlive/tlmgr.pl | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/Master/texmf/scripts/texlive/tlmgr.pl b/Master/texmf/scripts/texlive/tlmgr.pl index ca00d7c8740..9afccb86c7c 100755 --- a/Master/texmf/scripts/texlive/tlmgr.pl +++ b/Master/texmf/scripts/texlive/tlmgr.pl @@ -2009,6 +2009,34 @@ sub action_option { } else { info("Option $what = ", $localtlpdb->option($what), "\n"); } + } elsif ($what =~ m/^autobackup$/i) { + my $val = shift @ARGV; + if (defined($val)) { + if ($val =~ m/-?[0-9]+/) { + if ($val < -1) { + tlwarn "Value $val for autobackup not supported, must be >= -1\n"; + return; + } + } elsif ($val =~ m/^infty$/i) { + $val = -1; + } else { + tlwarn "Value $val for autobackup not supported, must be >= -1\n"; + return; + } + info("tlmgr: setting option $what to $val"); + $localtlpdb->option($what,$val); + $localtlpdb->save; + } else { + $val = $localtlpdb->option($what); + info("Option $what = $val"); + } + if ($val == -1) { + info(" (make and keep infinitely many backups)\n"); + } elsif ($val == 0) { + info(" (don't keep any backups)\n"); + } else { + info(" (make and keep $val backups)\n"); + } } elsif (member($what, @AllowedConfigOptions)) { # for all further options not handled above, we check whether they # appear in the list of allowed options; if they do, we set/read @@ -3146,6 +3174,19 @@ will not be removed by default. If C<autobackup> is 0 or positive, it specifies the number of backups to be kept. Thus, backups are disabled with 0 as the values. +B<Warning:> If you want to set the optin C<autobackup> on the command line +it might be interpreted as an option. In this case you have to use + + tlmgr option -- autobackup -1 + +The C<--> makes tlmgr stop parsing for options at that place. + +Alternatively, you can ue C<infty> instead of C<-1>, so the above is +equivalent to + + tlmgr option autobackup infty + + In the C<--clean> mode of the C<backup> action this option also specifies the number to be kept. |