diff options
author | Norbert Preining <preining@logic.at> | 2008-10-13 21:34:50 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2008-10-13 21:34:50 +0000 |
commit | 35134312cc70a867e41c3f2b1eeffaa456febcd2 (patch) | |
tree | cd5ecb78927c1268166b66d94ae068d057d7137a /Master/texmf/scripts | |
parent | 60f4ae31e1d6fb9ef4b740604caddad41d008082 (diff) |
add -pause option to tlmgr
git-svn-id: svn://tug.org/texlive/trunk@10956 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf/scripts')
-rwxr-xr-x | Master/texmf/scripts/texlive/tlmgr.pl | 51 |
1 files changed, 35 insertions, 16 deletions
diff --git a/Master/texmf/scripts/texlive/tlmgr.pl b/Master/texmf/scripts/texlive/tlmgr.pl index 5230453bd4d..5203155646f 100755 --- a/Master/texmf/scripts/texlive/tlmgr.pl +++ b/Master/texmf/scripts/texlive/tlmgr.pl @@ -90,6 +90,7 @@ my $opt_version = 0; my $opt_gui = 0; my $opt_gui_lang; my $opt_packagelogfile; +my $opt_pause = 0; TeXLive::TLUtils::process_logging_options(); GetOptions("location=s" => \$opt_location, @@ -97,6 +98,7 @@ GetOptions("location=s" => \$opt_location, "gui-lang=s" => \$opt_gui_lang, "package-logfile=s" => \$opt_packagelogfile, "version" => \$opt_version, + "pause" => \$opt_pause, "h|help|?" => \$opt_help) or pod2usage(2); my $action = shift; @@ -131,7 +133,7 @@ if ($opt_version || (defined $action && $action eq "version")) { print $rel_tl[$#rel_tl]; close (REL_TL); } - exit 0; + finish(0); } if (defined($action) && ($action =~ m/^help/i)) { @@ -191,7 +193,7 @@ if ($action =~ m/^_include_tlpobj$/) { } $localtlpdb->save; } - exit(0); + finish(0); } elsif ($action =~ m/^generate$/i) { merge_into(\%ret, action_generate()); } elsif ($action =~ m/^gui$/i) { @@ -201,11 +203,11 @@ if ($action =~ m/^_include_tlpobj$/) { } elsif ($action =~ m/^option$/i) { merge_into(\%ret, action_option()); # should we do postinstall stuff? - exit(0); + finish(0); } elsif ($action =~ m/^list$/i) { merge_into(\%ret, action_list()); # should we do postinstall stuff? - exit(0); + finish(0); } elsif ($action =~ m/^check$/i) { merge_into(\%ret, action_check()); } elsif ($action =~ m/^install$/i) { @@ -218,10 +220,10 @@ if ($action =~ m/^_include_tlpobj$/) { merge_into(\%ret, action_restore()); } elsif ($action =~ m/^search$/i) { merge_into(\%ret, action_search()); - exit(0); + finish(0); } elsif ($action =~ m/^show$/i) { merge_into(\%ret, action_show()); - exit(0); + finish(0); } elsif ($action =~ m/^remove$/i) { merge_into(\%ret, action_remove()); } elsif (($action eq "paper") || ($action eq "dvips") || ($action eq "xdvi") || @@ -241,7 +243,7 @@ if ($action =~ m/^_include_tlpobj$/) { system(@cmdline); } elsif ($action =~ m/^uninstall$/i) { merge_into(\%ret, action_uninstall()); - exit(0); + finish(0); } else { die "$0: unknown action: $action\n"; } @@ -310,7 +312,7 @@ if (defined($ret{'language'})) { } } -exit(0); +finish(0); # # remove_package removes a single package with all files (including the @@ -648,13 +650,13 @@ sub action_restore { } else { print "No backups available in $opt_backupdir\n"; } - exit 0; + finish(0); } if (!defined($rev)) { print "Available backups for $pkg: "; my @rs = sort (keys %{$backups{$pkg}}); print "@rs\n"; - exit 0; + finish(0); } # we did arrive here, so we try to restore ... if (defined($backups{$pkg}->{$rev})) { @@ -663,7 +665,7 @@ sub action_restore { my $yesno = <STDIN>; if ($yesno !~ m/^y(es)?$/i) { print "Ok, cancelling the restore!\n"; - exit(0); + finish(0); } } print "Restoring $pkg, $rev from $opt_backupdir/${pkg}.r${rev}.tar.lzma\n"; @@ -1360,7 +1362,7 @@ sub action_arch { } print "Already installed architectures are marked with (i)\n"; print "You can add new architectures with tlmgr arch add arch1 arch2\n"; - exit(0); + finish(0); } elsif ($what =~ m/^add$/i) { init_tlmedia(); my $mediatlpdb = $tlmediasrc->tlpdb; @@ -1472,7 +1474,7 @@ sub init_local_db { if (!setup_programs("$Master/tlpkg/installer", $localtlpdb->option_platform)) { tlwarn("Couldn't set up the necessary programs.\nInstallation of packages is not supported.\nPlease report to texlive\@tug.org.\n"); if (defined($should_i_die) && $should_i_die) { - exit 1; + finish(1); } else { tlwarn("Continuing anyway ...\n"); } @@ -1541,7 +1543,7 @@ sub action_gui { sub action_uninstall { if (win32()) { printf STDERR "Please use \"Add/Remove Programs\" from the Control Panel to removing TeX Live!\n"; - exit 1; + finish(1); } if ($opt_gui) { action_gui("uninstall"); @@ -1555,7 +1557,7 @@ sub action_uninstall { my $yesno = <STDIN>; if ($yesno !~ m/^y(es)?$/i) { print "Ok, cancelling the removal!\n"; - exit(0); + finish(0); } } print ("Ok, removing the whole installation:\n"); @@ -1687,7 +1689,7 @@ sub action_check { } else { print "No idea how to check that: $what\n"; } - exit $ret; + finish($ret); } # @@ -1853,6 +1855,19 @@ sub logpackage { } # +# finish +# evaluates only the -pause option, and then exits +sub finish { + my $ret = shift; + if ($opt_pause) { + print "Please press <ENTER> to finish process!\n"; + <STDIN>; + } + exit($ret); +} + + +# # return all the directories from which all content will be removed # # idea: @@ -1981,6 +1996,10 @@ C<TEXMFSYSVAR/web2c/tlmgr.log>. This option allows you to select a different file for that. This is separate from normal logging; for that, see the option C<-v> below, and TeXLive::TLUtils. +=item B<-pause> + +This option make B<tlmgr> wait for a user input before exiting. + =back The standard options are also accepted: C<--help/-h/-?>, C<--version>, |