summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xMaster/texmf-dist/scripts/texlive/tlmgr.pl25
-rw-r--r--Master/tlpkg/TeXLive/TLPaper.pm13
2 files changed, 36 insertions, 2 deletions
diff --git a/Master/texmf-dist/scripts/texlive/tlmgr.pl b/Master/texmf-dist/scripts/texlive/tlmgr.pl
index 9df03c3108c..ff5c8ce67c1 100755
--- a/Master/texmf-dist/scripts/texlive/tlmgr.pl
+++ b/Master/texmf-dist/scripts/texlive/tlmgr.pl
@@ -1185,7 +1185,15 @@ sub action_paper {
return($F_ERROR)
} elsif (!defined($newpaper)) { # tlmgr paper => show all current sizes.
- return TeXLive::TLPaper::paper_all($texmfconfig,undef);
+ my $ret = $F_OK;
+ for my $prog (sort keys %TeXLive::TLPaper::prog_to_pkg) {
+ my $pkg = $TeXLive::TLPaper::prog_to_pkg{$prog};
+ if ($localtlpdb->get_package($pkg)) {
+ $ret |= TeXLive::TLPaper::do_paper($prog,$texmfconfig,undef);
+ }
+ }
+ return($ret);
+ # return TeXLive::TLPaper::paper_all($texmfconfig,undef);
} elsif ($newpaper !~ /^(a4|letter)$/) { # tlmgr paper junk => complain.
$newpaper = "the empty string" if !defined($newpaper);
@@ -1194,11 +1202,24 @@ sub action_paper {
} else { # tlmgr paper {a4|letter} => do it.
return ($F_ERROR) if !check_on_writable();
- return (TeXLive::TLPaper::paper_all($texmfconfig,$newpaper));
+ my $ret = $F_OK;
+ for my $prog (sort keys %TeXLive::TLPaper::prog_to_pkg) {
+ my $pkg = $TeXLive::TLPaper::prog_to_pkg{$prog};
+ if ($localtlpdb->get_package($pkg)) {
+ $ret |= TeXLive::TLPaper::do_paper($prog,$texmfconfig,$newpaper);
+ }
+ }
+ return($ret);
+ # return (TeXLive::TLPaper::paper_all($texmfconfig,$newpaper));
}
} else { # program-specific paper
my $prog = $action; # first argument is the program to change
+ my $pkg = $TeXLive::TLPaper::prog_to_pkg{$prog};
+ if (!$localtlpdb->get_package($pkg)) {
+ tlwarn("$prg: package $pkg is not installed - cannot adjust paper size!\n");
+ return ($F_ERROR);
+ }
my $arg = shift @ARGV; # get "paper" argument
if (!defined($arg) || $arg ne "paper") {
$arg = "the empty string." if ! $arg;
diff --git a/Master/tlpkg/TeXLive/TLPaper.pm b/Master/tlpkg/TeXLive/TLPaper.pm
index e63419b0a6f..008cca9d662 100644
--- a/Master/tlpkg/TeXLive/TLPaper.pm
+++ b/Master/tlpkg/TeXLive/TLPaper.pm
@@ -29,6 +29,7 @@ BEGIN {
@EXPORT_OK = qw(
%paper_config_path_component
%paper_config_name
+ %prog_to_pkg
);
@EXPORT = @EXPORT_OK;
}
@@ -86,6 +87,18 @@ my %default_paper_config_name = (
"psutils" => "paper.cfg",
);
+# seems superficial, but we don't have a guarantee
+# that the package names and the 'call' names are
+# always the same.
+our %prog_to_pkg = (
+ "xdvi" => 'xdvi',
+ "pdftex" => 'pdftex',
+ "dvips" => 'dvips',
+ "dvipdfmx" => 'dvipdfmx',
+ "context" => 'context',
+ "psutils" => 'psutils',
+);
+
# Output is done to the components in this hash.
# If a value is undefined, we take the one from %default_...
#