summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2011-06-01 02:13:32 +0000
committerNorbert Preining <preining@logic.at>2011-06-01 02:13:32 +0000
commiteb5c077c29de8c9aafee41f3c3857df3128d675d (patch)
tree522778582798893ed65f482c01b5251e3615f763 /Master
parent283736b3e5d3f7112d5598324a4aa19406974c23 (diff)
take over paper setting from previous version if possible
git-svn-id: svn://tug.org/texlive/trunk@22712 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rwxr-xr-xMaster/install-tl48
-rw-r--r--Master/tlpkg/TeXLive/TLPaper.pm11
2 files changed, 59 insertions, 0 deletions
diff --git a/Master/install-tl b/Master/install-tl
index 286f9e9eb9d..b066354047e 100755
--- a/Master/install-tl
+++ b/Master/install-tl
@@ -57,6 +57,7 @@ use TeXLive::TLPOBJ;
use TeXLive::TLPDB;
use TeXLive::TLConfig;
use TeXLive::TLDownload;
+use TeXLive::TLPaper;
if (win32) {
require TeXLive::TLWinGoo;
@@ -1640,6 +1641,53 @@ sub import_settings_from_old_tlpdb {
++$vars{'n_systems_available'} if ($key=~/^binary/);
}
}
+ #
+ # try to import paper settings
+ my $xdvi_paper;
+ if (!win32()) {
+ $xdvi_papers = TeXLive::TLPaper::get_paper("xdvi");
+ }
+ my $pdftex_paper = TeXLive::TLPaper::get_paper("pdftex");
+ my $dvips_paper = TeXLive::TLPaper::get_paper("dvips");
+ my $dvipdfm_paper = TeXLive::TLPaper::get_paper("dvipdfm");
+ my $dvipdfmx_paper = TeXLive::TLPaper::get_paper("dvipdfmx");
+ my $context_paper;
+ if (defined($previoustlpdb->get_package("context"))) {
+ $context_paper = TeXLive::TLPaper::get_paper("context");
+ }
+ my $common_paper = "";
+ if (defined($xdvi_paper)) {
+ $common_paper = $xdvi_paper;
+ }
+ $common_paper =
+ ($common_paper ne $context_paper ? "no-agree-on-paper" : $common_paper)
+ if (defined($context_paper));
+ $common_paper =
+ ($common_paper ne $pdftex_paper ? "no-agree-on-paper" : $common_paper)
+ if (defined($pdftex_paper));
+ $common_paper =
+ ($common_paper ne $dvips_paper ? "no-agree-on-paper" : $common_paper)
+ if (defined($dvips_paper));
+ $common_paper =
+ ($common_paper ne $dvipdfm_paper ? "no-agree-on-paper" : $common_paper)
+ if (defined($dvipdfm_paper));
+ $common_paper =
+ ($common_paper ne $dvipdfmx_paper ? "no-agree-on-paper" : $common_paper)
+ if (defined($dvipdfmx_paper));
+ if ($common_paper eq "no-agree-on-paper") {
+ tlwarn("Previous installation uses different paper settings.\n");
+ tlwarn("You will need to select your preferred paper sizes manually.\n\n");
+ } else {
+ if ($common_paper eq "letter") {
+ $vars{'option_letter'} = 1;
+ } elsif ($common_paper eq "a4") {
+ # do nothing
+ } else {
+ tlwarn("Previous installation has common paper setting of: $common_paper\n");
+ tlwarn("After installation has finished, you will need\n");
+ tlwarn(" to redo this setting by running:\n");
+ }
+ }
}
# do everything to select a scheme
diff --git a/Master/tlpkg/TeXLive/TLPaper.pm b/Master/tlpkg/TeXLive/TLPaper.pm
index 080b191622a..907762e9ffb 100644
--- a/Master/tlpkg/TeXLive/TLPaper.pm
+++ b/Master/tlpkg/TeXLive/TLPaper.pm
@@ -146,6 +146,17 @@ sub get_paper_list {
return ( &{$paper_sub{$prog}} ( "/dummy", "--returnlist" ) );
}
+=item C<get_paper($prog)>
+
+Returns the currently selected paper size for program C<$prog>.
+
+=cut
+
+sub get_paper {
+ my @pps = get_paper_list(shift);
+ return $pps[0];
+}
+
=item C<do_paper($prog,$texmfsysconfig,@args)>
Call the paper subroutine for C<$prog>, passing args.