summaryrefslogtreecommitdiff
path: root/Master/texmf/scripts
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2008-12-21 22:15:24 +0000
committerKarl Berry <karl@freefriends.org>2008-12-21 22:15:24 +0000
commitfed3087a9c43d01282d47190bba150935827f801 (patch)
tree649ff9d5d5c1bfbac12705e51cedb47d46122383 /Master/texmf/scripts
parent1f6570163ced0e2c0acb9abdfac4254240818ed1 (diff)
undo papersize dev changes that were not ready yet
git-svn-id: svn://tug.org/texlive/trunk@11671 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf/scripts')
-rwxr-xr-xMaster/texmf/scripts/texlive/tlmgr2.pl60
1 files changed, 30 insertions, 30 deletions
diff --git a/Master/texmf/scripts/texlive/tlmgr2.pl b/Master/texmf/scripts/texlive/tlmgr2.pl
index 3b350bc21f6..34a95fe4611 100755
--- a/Master/texmf/scripts/texlive/tlmgr2.pl
+++ b/Master/texmf/scripts/texlive/tlmgr2.pl
@@ -83,22 +83,32 @@ 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");
-our $tlmediasrc; # media from which we install/update
+# 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 $tlmediatlpdb;
-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
+# the local tlpdb
+our $localtlpdb;
+# a hash for saving the 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";
@@ -107,10 +117,6 @@ 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;
@@ -345,7 +351,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());
@@ -355,10 +361,12 @@ sub execute_action {
merge_into(\%ret, action_arch());
} elsif ($action =~ m/^option$/i) {
merge_into(\%ret, action_option());
- finish(0); # do not do postinstall stuff
+ # should we do postinstall stuff?
+ finish(0);
} elsif ($action =~ m/^list$/i) {
merge_into(\%ret, action_list());
- finish(0); # do not do postinstall stuff
+ # should we do postinstall stuff?
+ finish(0);
} elsif ($action =~ m/^check$/i) {
merge_into(\%ret, action_check());
} elsif ($action =~ m/^install$/i) {
@@ -377,11 +385,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");
}
- unshift(@ARGV, $action);
+ @ARGV = ($action, @ARGV);
merge_into(\%ret, action_paper());
} elsif ($action =~ m/^uninstall$/i) {
merge_into(\%ret, action_uninstall());
@@ -389,16 +397,13 @@ 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);
}
@@ -713,12 +718,11 @@ sub action_remove {
}
}
-
-# PAPER
-# @ARGV can look like:
+# action_paper
+# ARGV can look like:
# paper a4
# paper letter
-# [xdvi|dvips|pdftex|dvipdfm|dvipdfmx|context] paper [help|<size>|--list]
+# [xdvi|dvips|pdftex|dvipdfm|dvipdfmx|context] paper [help|papersize|--list]
#
sub action_paper {
my %ret;
@@ -737,15 +741,16 @@ sub action_paper {
my $action = shift @ARGV;
if ($action =~ m/^paper$/i) {
my $newpaper = shift @ARGV;
- if (!defined($newpaper) || $newpaper !~ /^(a4|letter)$/) {
- tlwarn("tlmgr: paper expects a4 or letter, not $newpaper\n");
+ if (!defined($newpaper) ||
+ (($newpaper ne "a4") && ($newpaper ne "letter"))) {
+ tlwarn("tlmgr paper needs an argument: a4 | letter\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, TeXLive::TLPaper:paper_all($texmfsysconfig, $newpaper));
+ merge_into(\%ret, paper_all($texmfsysconfig, $newpaper));
} else {
# now we have as first argument a program
my $prog = $action;
@@ -755,7 +760,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,TeXLive::TLPaper::paper_sub($prog,$texmfsysconfig,@ARGV));
+ merge_into( \%ret, &{$papersetting_subs{$prog}}($texmfsysconfig, @ARGV));
}
if ($localtlpdb->option_create_formats) {
$ret{"format"} = 1;
@@ -764,8 +769,6 @@ sub action_paper {
}
-# SHOW
-#
sub action_show {
if ($opts{"gui"}) {
action_gui("config");
@@ -849,9 +852,6 @@ sub action_show {
return;
}
-
-# SEARCH
-#
sub action_search {
my %ret;
tlwarn("machine-readable output not supported for search\n")