From 55345a3b643b440dcf96789675a34ecdb25571d4 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Tue, 5 May 2009 15:52:39 +0000 Subject: 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 --- Master/texmf/scripts/texlive/tlmgr.pl | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'Master') 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 is 0 or positive, it specifies the number of backups to be kept. Thus, backups are disabled with 0 as the values. +B If you want to set the optin C 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 instead of C<-1>, so the above is +equivalent to + + tlmgr option autobackup infty + + In the C<--clean> mode of the C action this option also specifies the number to be kept. -- cgit v1.2.3