From 7517ae808165ce92d69f54fb2e0ae6e83ca0c4b6 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Fri, 19 Dec 2008 02:17:21 +0000 Subject: use clean:-99 as type, so that it does not accidently takes other arguments as values for --clean (since it searched for an integer) git-svn-id: svn://tug.org/texlive/trunk@11650 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf/scripts/texlive/tlmgr2.pl | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'Master/texmf') diff --git a/Master/texmf/scripts/texlive/tlmgr2.pl b/Master/texmf/scripts/texlive/tlmgr2.pl index c98f5f4dcd2..fd99e353720 100755 --- a/Master/texmf/scripts/texlive/tlmgr2.pl +++ b/Master/texmf/scripts/texlive/tlmgr2.pl @@ -142,7 +142,7 @@ my %actionoptions = ( "dry-run|n" => 1, "force" => 1 }, "backup" => { "backupdir" => "=s", - "clean" => ":s", + "clean" => ":-99", "all" => 1, "dry-run|n" => 1 }, "update" => { "no-depends" => 1, @@ -1007,16 +1007,17 @@ sub action_backup { # that parallels the value of autoclean in the configuration # we have to be careful, because if simply --clean is given, we should # check for the value saved in the tlpdb, and if that is not present - # do nothing. But Getopt::Long with clean:i leaves 0 in $opts{"clean"} if - # it is present. So + # do nothing. + # We have set clean to clean:-99 which makes -99 the default value + # if only --clean is given without any argument # !defined($opts{"clean"}) -> no --clean given - # $opts{"clean"} = "" -> --clean without argument given, check tlpdb + # $opts{"clean"} = -99 -> --clean without argument given, check tlpdb # $opts{"clean"} = -1, 0, N -> --clean=N given, check argument # my $clean_mode = 0; $clean_mode = 1 if defined($opts{"clean"}); if ($clean_mode) { - if ($opts{"clean"} eq "") { + if ($opts{"clean"} == -99) { # we need to check the tlpdb $opts{"clean"} = $localtlpdb->option("autobackup"); if (!$opts{"clean"}) { -- cgit v1.2.3