diff options
author | Karl Berry <karl@freefriends.org> | 2008-12-21 18:59:24 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2008-12-21 18:59:24 +0000 |
commit | 196ab868588ca3c2ee5bfedba9de66471c3c8a51 (patch) | |
tree | f84488a0d2527bfe345e5d444495a9ba97fc9e0c /Master | |
parent | f67a7d0a0966a1dec3442e40bcbd54ae244fb789 (diff) |
total-size, use tabs
git-svn-id: svn://tug.org/texlive/trunk@11669 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rwxr-xr-x | Master/texmf/scripts/texlive/tlmgr2.pl | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/Master/texmf/scripts/texlive/tlmgr2.pl b/Master/texmf/scripts/texlive/tlmgr2.pl index cf0890f95bf..e2e0a3af182 100755 --- a/Master/texmf/scripts/texlive/tlmgr2.pl +++ b/Master/texmf/scripts/texlive/tlmgr2.pl @@ -83,32 +83,22 @@ use TeXLive::TLConfig; use TeXLive::TLMedia; use TeXLive::TLPDB; use TeXLive::TLPOBJ; +use TeXLive::TLPaper; use TeXLive::TLPostActions; use TeXLive::TLUtils; use TeXLive::TLWinGoo; TeXLive::TLUtils->import(qw(member info give_ctan_mirror win32 dirname mkdirhier merge_into copy log debug)); -require("papersize-setting.pl"); -our %papersetting_subs; - binmode(STDOUT, ":utf8"); binmode(STDERR, ":utf8"); -# global variable that specifies if a call to finish() should actually -# finish the program or immediately return -$::gui_mode = 0; - -# used variables -# the TLMedia from which we install/update -our $tlmediasrc; +our $tlmediasrc; # media from which we install/update our $tlmediatlpdb; -# the local tlpdb -our $localtlpdb; -# a hash for saving the options saved into the local tlpdb +our $location; # location from which the new packages come +our $localtlpdb; # local installation which we are munging +# a hash for saving the TL options saved into the local tlpdb my %options; -# the location from where we install -our $location; # flags for machine readable form our $FLAG_REMOVE = "d"; @@ -117,6 +107,10 @@ our $FLAG_UPDATE = "u"; our $FLAG_REVERSED_UPDATE = "r"; our $FLAG_AUTOINSTALL = "a"; +# global variable that determines whether a call to finish() +# exits the program or immediately returns. +$::gui_mode = 0; + # option variables $::machinereadable = 0; @@ -351,7 +345,7 @@ sub execute_action { finish(0); } elsif ($action =~ m/^get-mirror$/i) { my $loc = give_ctan_mirror(); - print("$loc\n"); + print "$loc\n"; finish(0); } elsif ($action =~ m/^generate$/i) { merge_into(\%ret, action_generate()); @@ -361,12 +355,10 @@ sub execute_action { merge_into(\%ret, action_arch()); } elsif ($action =~ m/^option$/i) { merge_into(\%ret, action_option()); - # should we do postinstall stuff? - finish(0); + finish(0); # do not do postinstall stuff } elsif ($action =~ m/^list$/i) { merge_into(\%ret, action_list()); - # should we do postinstall stuff? - finish(0); + finish(0); # do not do postinstall stuff } elsif ($action =~ m/^check$/i) { merge_into(\%ret, action_check()); } elsif ($action =~ m/^install$/i) { @@ -385,11 +377,11 @@ sub execute_action { finish(0); } elsif ($action =~ m/^remove$/i) { merge_into(\%ret, action_remove()); - } elsif ($action =~ /paper|dvips|xdvi|pdftex|dvipdfmx?|context/) { + } elsif ($action =~ /^(paper|dvips|xdvi|pdftex|dvipdfmx?|context)$/) { if ($opts{"gui"}) { action_gui("config"); } - @ARGV = ($action, @ARGV); + unshift(@ARGV, $action); merge_into(\%ret, action_paper()); } elsif ($action =~ m/^uninstall$/i) { merge_into(\%ret, action_uninstall()); @@ -397,13 +389,16 @@ sub execute_action { } else { die "$0: unknown action: $action\n"; } + # close the special log file if ($packagelogfile && !$::gui_mode) { info("tlmgr: package log updated at $packagelogfile\n") if $packagelogged; close(PACKAGELOG); } + # run external programs. my $error_count = &handle_ret_hash(%ret); + # done, just in case there are 256 errors. finish($error_count ? 1 : 0); } @@ -718,11 +713,12 @@ sub action_remove { } } -# action_paper -# ARGV can look like: + +# PAPER +# @ARGV can look like: # paper a4 # paper letter -# [xdvi|dvips|pdftex|dvipdfm|dvipdfmx|context] paper [help|papersize|--list] +# [xdvi|dvips|pdftex|dvipdfm|dvipdfmx|context] paper [help|<size>|--list] # sub action_paper { my %ret; @@ -741,16 +737,15 @@ sub action_paper { my $action = shift @ARGV; if ($action =~ m/^paper$/i) { my $newpaper = shift @ARGV; - if (!defined($newpaper) || - (($newpaper ne "a4") && ($newpaper ne "letter"))) { - tlwarn("tlmgr paper needs an argument: a4 | letter\n"); + if (!defined($newpaper) || $newpaper !~ /^(a4|letter)$/) { + tlwarn("tlmgr: paper expects a4 or letter, not $newpaper\n"); return; } # output is done to the path components as given in # our %paper_config_path_component, and if not present the defaults # in %default_paper_config_path_component; # together with the tree as given in the first argument of paper_* - merge_into(\%ret, paper_all($texmfsysconfig, $newpaper)); + merge_into(\%ret, TeXLive::TLPaper:paper_all($texmfsysconfig, $newpaper)); } else { # now we have as first argument a program my $prog = $action; @@ -760,7 +755,7 @@ sub action_paper { # see above for the selection of the output # if we want to change the output the value in %paper_config_path_component # has to be changed - merge_into( \%ret, &{$papersetting_subs{$prog}}($texmfsysconfig, @ARGV)); + merge_into(\%ret,TeXLive::TLPaper::paper_sub($prog,$texmfsysconfig,@ARGV)); } if ($localtlpdb->option_create_formats) { $ret{"format"} = 1; @@ -769,6 +764,8 @@ sub action_paper { } +# SHOW +# sub action_show { if ($opts{"gui"}) { action_gui("config"); @@ -852,6 +849,9 @@ sub action_show { return; } + +# SEARCH +# sub action_search { my %ret; tlwarn("machine-readable output not supported for search\n") @@ -1536,7 +1536,7 @@ sub action_update { $localtlpdb->option_install_docfiles, @new, @updated )}; - print "totalsize $sizes{'__TOTAL__'}\n" if $::machinereadable; + print "total-size\t$sizes{'__TOTAL__'}\n" if $::machinereadable; print "end-of-header\n" if $::machinereadable; # @@ -2567,10 +2567,10 @@ sub init_tlmedia { if ($location =~ m/^($TeXLiveServerURL|ctan$)/) { $location = give_ctan_mirror(); } - # that "location-url: $location should not be changed since GUI programs - # might depend on it. In case of $::machinereadable all the info + # that "location-url" line should not be changed since GUI programs + # depend on it. In case of $::machinereadable all the info # output is also going to STDERR. - print "location-url $location\n" if $::machinereadable; + print "location-url\t$location\n" if $::machinereadable; info("tlmgr: installation location $location\n"); # $tlmediasrc is a global variable |