summaryrefslogtreecommitdiff
path: root/Master/tlpkg/installer
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/installer')
-rw-r--r--Master/tlpkg/installer/install-menu-perltk-de.pl59
-rw-r--r--Master/tlpkg/installer/install-menu-perltk.pl681
-rw-r--r--Master/tlpkg/installer/install-menu-perltk.pl.old524
-rwxr-xr-xMaster/tlpkg/installer/install-menu-text.pl836
-rw-r--r--Master/tlpkg/installer/texlive2008.pngbin0 -> 46440 bytes
5 files changed, 2100 insertions, 0 deletions
diff --git a/Master/tlpkg/installer/install-menu-perltk-de.pl b/Master/tlpkg/installer/install-menu-perltk-de.pl
new file mode 100644
index 00000000000..e89c764e683
--- /dev/null
+++ b/Master/tlpkg/installer/install-menu-perltk-de.pl
@@ -0,0 +1,59 @@
+
+my $svnrev = '$Revision$';
+$svnrev =~ m/: ([0-9]+) /;
+$::langrevision = $1;
+
+our %translatedtext = ( title => 'TeX Live 2008 Installation',
+ custom => 'Weitere Einstellungen',
+ basicinfo => 'Grundlegende Informationen',
+ dirsetup => "Setup der Ordner",
+ options => 'Optionen',
+ sysint => 'System Integration',
+ change => 'Ändern',
+ toggle => 'Ändern',
+ install => 'TeX Live installieren',
+ finished => 'Installation beendet',
+ finbut => 'Ende',
+ quit => 'Abbruch',
+ ok => 'Ok',
+ cancel => 'Abbruch',
+ status => 'Status Ausgabe',
+ changevar => 'Ändern der Werte von Variablen',
+ enterpath => 'Bitte geben Sie den Pfad ein für ',
+ selectscheme => 'Auswahl des Schema',
+ selectstdcol => 'Auswahl der zu installierenden Sammlungen',
+ selectall => 'Alle anwählen',
+ selectnone => 'Alle abwählen',
+ selectlang => 'Sprachauswahl',
+ selectdoc => 'Dokumentationssprachauswahl',
+ createsym => 'Erstellen von symbolischen Links in Standardordnern',
+ binto => 'Programme nach: ',
+ manto => 'Hilfeseiten nach: ',
+ infoto => 'Infoseiten nach: ',
+ onnet => 'Am Netz',
+ ondisk => 'Auf dem Medium',
+ selectsys => 'Auswahl von arch-os',
+ clicknetbin => 'Klicken für Netzwerk Programme',
+ outof => 'von',
+ collof => 'Sammlungen von',
+ diskreq => 'benötigter Festplattenplatz',
+ yes => 'Ja',
+ no => 'Nein',
+ );
+
+
+our %translatedlabels = ( binsys => 'Binary System(s)',
+ scheme => 'Ausgewähltes Schema',
+ stdcoll => 'Standardsammlungen',
+ langcoll => 'Sprachsammlungen',
+ texdir => 'TEXDIR (Hauptordner für TeX)',
+ localdir => 'TEXMFLOCAL (lokale Styles etc)',
+ sysvardir => 'TEXMFSYSVAR (lokalen Konfiguration)',
+ optletter => 'Standardmäßig letter anstelle von A4',
+ optfmt => 'Alle Formatdateien erstellen',
+ optdoc => 'Installation der font/macro Dokumentation',
+ optsrc => 'Installation der font/macro Quellen',
+ symlink => 'Symbolische Links in Systemordnern',
+ );
+
+
diff --git a/Master/tlpkg/installer/install-menu-perltk.pl b/Master/tlpkg/installer/install-menu-perltk.pl
new file mode 100644
index 00000000000..739aceeaf2a
--- /dev/null
+++ b/Master/tlpkg/installer/install-menu-perltk.pl
@@ -0,0 +1,681 @@
+#!/usr/bin/env perl
+#
+# $Id$
+#
+# Copyright 2008 Norbert Preining, Reinhard Kotucha
+# This file is licensed under the GNU General Public License version 2
+# or any later version.
+#
+#
+# TODO:
+# - does the DoOneEvent *NEVER* hang???
+# - translation into other languages
+# - dynamic computation of column sizes? how could that be done?
+
+my $svnrev = '$Revision$';
+$svnrev =~ m/: ([0-9]+) /;
+$::menurevision = $1;
+$::langrevision = $1;
+
+
+our %vars;
+our $tlpdb;
+our @collections_std;
+our @collections_lang;
+our @collections_lang_doc;
+our $texlive_release;
+our $trynet;
+our $max_bins_on_CD;
+
+our $MENU_INSTALL = 0;
+our $MENU_ABORT = 1;
+our $MENU_QUIT = 2;
+our $MENU_ALREADYDONE = 3;
+
+my $return = $MENU_INSTALL;
+
+require Tk;
+require Tk::Dialog;
+require Tk::PNG;
+
+my $mw;
+
+my $bintextbutton;
+my $schemebutton;
+my $collectionstext;
+my $texmflocaltext;
+my $texmfsysvartext;
+my $texdirtext;
+my $symlinktext;
+my $optletterstate;
+my $optfmtstate;
+my $optsrcstate;
+my $optdocstate;
+
+push @::start_install_hook, sub { update_statusbar("Starting Installation");
+ Tk::DoOneEvent(Tk::Event::DONT_WAIT); Tk::DoOneEvent(Tk::Event::DONT_WAIT); };
+push @::start_postinst_hook, sub { update_statusbar("Starting Post Installation Jobs");
+ Tk::DoOneEvent(Tk::Event::DONT_WAIT); Tk::DoOneEvent(Tk::Event::DONT_WAIT); };
+push @::end_install_hook, sub { update_statusbar("Installation finished");
+ Tk::DoOneEvent(Tk::Event::DONT_WAIT); Tk::DoOneEvent(Tk::Event::DONT_WAIT); };
+
+
+push @::install_packages_hook, \&update_statusbar;
+# no idea how many of those are necessary, 1 is definitely not enough!
+push @::install_packages_hook, sub { Tk::DoOneEvent(Tk::Event::DONT_WAIT); };
+push @::install_packages_hook, sub { Tk::DoOneEvent(Tk::Event::DONT_WAIT); };
+push @::install_packages_hook, sub { Tk::DoOneEvent(Tk::Event::DONT_WAIT); };
+push @::install_packages_hook, sub { Tk::DoOneEvent(Tk::Event::DONT_WAIT); };
+push @::install_packages_hook, sub { Tk::DoOneEvent(Tk::Event::DONT_WAIT); };
+push @::install_packages_hook, sub { Tk::DoOneEvent(Tk::Event::DONT_WAIT); };
+push @::install_packages_hook, sub { Tk::DoOneEvent(Tk::Event::DONT_WAIT); };
+push @::install_packages_hook, sub { Tk::DoOneEvent(Tk::Event::DONT_WAIT); };
+push @::install_packages_hook, sub { Tk::DoOneEvent(Tk::Event::DONT_WAIT); };
+push @::install_packages_hook, sub { Tk::DoOneEvent(Tk::Event::DONT_WAIT); };
+push @::install_packages_hook, sub { Tk::DoOneEvent(Tk::Event::DONT_WAIT); };
+push @::install_packages_hook, sub { Tk::DoOneEvent(Tk::Event::DONT_WAIT); };
+push @::install_packages_hook, sub { Tk::DoOneEvent(Tk::Event::DONT_WAIT); };
+push @::install_packages_hook, sub { Tk::DoOneEvent(Tk::Event::DONT_WAIT); };
+push @::install_packages_hook, sub { Tk::DoOneEvent(Tk::Event::DONT_WAIT); };
+push @::install_packages_hook, sub { Tk::DoOneEvent(Tk::Event::DONT_WAIT); };
+
+sub update_statusbar {
+ my $p = shift;
+ $::statusbar->configure(-text => "$p");
+}
+
+my %text = ( title => 'TeX Live 2008 Installation',
+ basicinfo => 'Basic Information',
+ custom => 'Further Customization',
+ dirsetup => "Directories' setup",
+ options => 'Options',
+ sysint => 'System Integration',
+ change => 'Change',
+ toggle => 'Toggle',
+ install => 'Install TeX Live',
+ finished => 'Installation finished',
+ finbut => 'Finish',
+ quit => 'Quit',
+ ok => 'Ok',
+ cancel => 'Cancel',
+ status => 'Status output',
+ changevar => 'Change variable value',
+ enterpath => 'Enter path for ',
+ selectscheme => 'Select Scheme',
+ selectstdcol => 'Select the collections to be installed',
+ selectall => 'Select All',
+ selectnone => 'Deselect All',
+ selectlang => 'Language Selection',
+ selectdoc => 'Doc/Language Selection',
+ createsym => 'create symlinks in standard directories',
+ binto => 'binaries to: ',
+ manto => 'manpages to: ',
+ infoto => 'info to: ',
+ onnet => 'On Net',
+ ondisk => 'On Disk',
+ selectsys => 'Select arch-os',
+ clicknetbin => 'Click for net bins',
+ outof => 'out of',
+ collof => 'collections out of',
+ diskreq => 'disk space required',
+ yes => 'Yes',
+ no => 'No',
+ );
+
+
+my %labels = ( binsys => 'Binary System(s)',
+ scheme => 'Selected Scheme',
+ stdcoll => 'Standard Collections',
+ langcoll => 'Language Collections',
+ texdir => 'TEXDIR (main TeX directory)',
+ localdir => 'TEXMFLOCAL (local styles etc)',
+ sysvardir => 'TEXMFSYSVAR (local config)',
+ optletter => 'Use letter instead of A4 by default',
+ optfmt => 'Create all format files',
+ optdoc => 'Install font/macro doc tree',
+ optsrc => 'Install font/macro source tree',
+ symlink => 'Install symlinks to system directories',
+ );
+
+if ($::lang ne "en") {
+ eval { require("installer/install-menu-perltk-$::lang.pl"); };
+ if ($@) {
+ # couldn't find the file, continue with english
+ warn "Couldn't find language file installer/install-menu-perltk-$::lang.pl: $!\nContinuing in English!\n";
+ } else {
+ # merge the translated strings into the text string
+ foreach my $k (keys %translatedtext) {
+ $text{$k} = $translatedtext{$k};
+ }
+ foreach my $k (keys %translatedlabels) {
+ $labels{$k} = $translatedlabels{$k};
+ }
+ }
+}
+
+my $letteryesno = $text{'no'};
+my $fmtyesno = $text{'no'};
+my $srcyesno = $text{'yes'};
+my $docyesno = $text{'yes'};
+
+sub run_menu {
+ # computing $a:
+ my $a = 0;
+ foreach my $l (keys %labels) {
+ my $l = length($labels{$l});
+ $a = $l if ($l > $a);
+ }
+ # add one char width for spacing
+ $a++;
+ my $b = 35;
+ if (win32()) {
+ $b = 30;
+ }
+ # computation of $c
+ my $c = 0;
+ foreach my $l (qw/change toggle/) {
+ my $l = length($text{$l});
+ $c = $l if ($l > $c);
+ }
+ tllog($::LOG_DDEBUG, "setting column widhts to a=$a, c=$c\n");
+ calc_depends;
+ $mw = MainWindow->new;
+
+ # image frame on the left
+ my $fl = $mw->Frame;
+ my $img = $fl->Photo(-format => 'png', -file => "tlpkg/installer/texlive2008.png");
+ $fl->Label(-image => $img)->pack;
+ $fl->Label(-text => "v$::installerrevision/$::menurevision" . ($::lang eq "en"? "" : "/$::lang$langrevision"))->pack;
+
+ # data frame on the right
+ my $fr = $mw->Frame;
+ $fl->pack(-side => 'left');
+ $fr->pack(-side => 'right');
+ $fr->Label(-text => $text{'title'})->pack;
+ $fr->Label(-text => "------- $text{'basicinfo'} -------")->pack;
+
+ # binary system line
+ my $fbin = $fr->Frame; $fbin->pack;
+ $fbin->Label(-text => $labels{'binsys'}, -width => $a, -anchor => 'w')->pack(-side => 'left');
+ $bintextbutton = $fbin->Label(-width => $b, -anchor => 'w'); $bintextbutton->pack(-side => 'left');
+ $fbin->Button(-width => $c, -text => $text{'change'}, -command => sub { menu_select_binsystems(); })->pack(-side => 'left');
+
+ # scheme line
+ my $fscheme = $fr->Frame; $fscheme->pack;
+ $fscheme->Label(-text => $labels{'scheme'}, -width => $a, -anchor => 'w')->pack(-side => 'left');
+ $schemebutton = $fscheme->Label(-width => $b, -anchor => 'w'); $schemebutton->pack(-side => 'left');
+ $fscheme->Button(-width => $c, -text => $text{'change'}, -command => sub { menu_select_scheme(); })->pack(-side => 'left');
+
+ # further customization
+ $fr->Label(-text => "------- $text{'custom'} -------")->pack;
+
+ # standard collection line
+ my $fcoll = $fr->Frame; $fcoll->pack;
+ $fcoll->Label(-text => $labels{'stdcoll'}, -width => $a+$b, -anchor => 'w')->pack(-side => 'left');
+ $fcoll->Button(-width => $c, -text => $text{'change'}, -command => sub { menu_select_standard_collections(); })->pack(-side => 'left');
+
+ # lang collection line
+ my $flang = $fr->Frame; $flang->pack;
+ $flang->Label(-text => $labels{'langcoll'}, -width => $a+$b, -anchor => 'w')->pack(-side => 'left');
+ $flang->Button(-width => $c, -text => $text{'change'}, -command => sub { menu_select_lang_collections(); })->pack(-side => 'left');
+
+ $collectionstext = $fr->Label();
+ $collectionstext->pack;
+
+ # further customization
+ $fr->Label(-text => "------- $text{'dirsetup'} -------")->pack;
+
+ # texdir line
+ my $ftexdir = $fr->Frame; $ftexdir->pack;
+ $ftexdir->Label(-text => $labels{'texdir'}, -width => $a, -anchor => 'w')->pack(-side => 'left');
+ $texdirtext = $ftexdir->Label(-width => $b, -anchor => 'w')->pack(-side => 'left');
+ $ftexdir->Button(-width => $c, -text => $text{'change'}, -command => sub { menu_edit_vars_value("TEXDIR"); })->pack(-side => 'left');
+
+ # texmflocal line
+ my $flocal = $fr->Frame; $flocal->pack;
+ $flocal->Label(-text => $labels{'localdir'}, -width => $a, -anchor => 'w')->pack(-side => 'left');
+ $texmflocaltext = $flocal->Label(-width => $b, -anchor => 'w')->pack(-side => 'left');
+ $flocal->Button(-width => $c, -text => $text{'change'}, -command => sub { menu_edit_vars_value("TEXMFLOCAL"); })->pack(-side => 'left');
+
+ # texmflocal line
+ my $fsys = $fr->Frame; $fsys->pack;
+ $fsys->Label(-text => $labels{'sysvardir'}, -width => $a, -anchor => 'w')->pack(-side => 'left');
+ $texmfsysvartext = $fsys->Label(-width => $b, -anchor => 'w')->pack(-side => 'left');
+ $fsys->Button(-width => $c, -text => $text{'change'}, -command => sub { menu_edit_vars_value("TEXMFSYSVAR"); })->pack(-side => 'left');
+
+
+ # Options
+ $fr->Label(-text => "------- $text{'options'} -------")->pack;
+
+ # optpaper
+ my $fletter = $fr->Frame; $fletter->pack;
+ $fletter->Label(-text => $labels{'optletter'}, -width => $a, -anchor => 'w')->pack(-side => 'left');
+ $fletter->Label(-width => $b, -anchor => 'w', -textvariable => \$letteryesno)->pack(-side => 'left');
+ $fletter->Button(-width => $c, -text => $text{'toggle'}, -command => sub { toggle_and_set_opt_variable(\$vars{'option_letter'}, \$letteryesno); })->pack(-side => 'left');
+
+ my $ffmt = $fr->Frame; $ffmt->pack;
+ $ffmt->Label(-text => $labels{'optfmt'}, -width => $a, -anchor => 'w')->pack(-side => 'left');
+ $ffmt->Label(-width => $b, -anchor => 'w', -textvariable => \$fmtyesno)->pack(-side => 'left');
+ $ffmt->Button(-width => $c, -text => $text{'toggle'}, -command => sub { toggle_and_set_opt_variable(\$vars{'option_fmt'}, \$fmtyesno); })->pack(-side => 'left');
+
+ my $fdoc = $fr->Frame; $fdoc->pack;
+ $fdoc->Label(-text => $labels{'optdoc'}, -width => $a, -anchor => 'w')->pack(-side => 'left');
+ $fdoc->Label(-width => $b, -anchor => 'w', -textvariable => \$docyesno)->pack(-side => 'left');
+ $fdoc->Button(-width => $c, -text => $text{'toggle'}, -command => sub { toggle_and_set_opt_variable(\$vars{'option_doc'}, \$docyesno); })->pack(-side => 'left');
+
+ my $fsrc = $fr->Frame; $fsrc->pack;
+ $fsrc->Label(-text => $labels{'optsrc'}, -width => $a, -anchor => 'w')->pack(-side => 'left');
+ $fsrc->Label(-width => $b, -anchor => 'w', -textvariable => \$srcyesno)->pack(-side => 'left');
+ $fsrc->Button(-width => $c, -text => $text{'toggle'}, -command => sub { toggle_and_set_opt_variable(\$vars{'option_src'}, \$srcyesno); })->pack(-side => 'left');
+
+ if (unix()) {
+ # Symlinks
+ $fr->Label(-text => "------- $text{'sysint'} -------")->pack;
+
+ my $fsym = $fr->Frame; $fsym->pack;
+ $fsym->Label(-text => $labels{'symlink'}, -width => $a, -anchor => 'w')->pack(-side => 'left');
+ $symlinktext = $fsym->Label(-width => $b, -anchor => 'w')->pack(-side => 'left');
+ $fsym->Button(-width => $c, -text => $text{'change'}, -command => sub { menu_select_symlink(); })->pack(-side => 'left')
+ }
+
+ # install/cancel buttons
+ my $f3 = $fr->Frame;
+ $f3->Button(
+ -text => $text{'install'},
+ -command => sub { do_installation();
+ $return = $MENU_ALREADYDONE;
+ $fr->Dialog(-text => $text{'finished'}, -buttons => [ $text{'finbut'} ])->Show;
+ $mw->destroy },
+ )->pack(-side => 'left');
+ $f3->Button(
+ -text => $text{'quit'},
+ -command => sub { $return = $MENU_ABORT; $mw->destroy }
+ )->pack(-side => 'right');
+ $f3->pack(-expand => 'x');
+ $::statusbar = $fr->Label(-text => $text{'status'});
+ $::statusbar->pack;
+ menu_update_texts();
+ Tk::MainLoop();
+ return($return);
+}
+
+sub menu_edit_vars_value {
+ my $key = shift;
+ my $sw = $mw->Toplevel(-title => $text{'changevar'});
+ my $val = $vars{$key};
+ $sw->Label(-text => $text{'enterpath'} . "$key:")->pack;
+ my $entry = $sw->Entry(-textvariable => $val, -width => 60);
+ $entry->pack;
+ my $f = $sw->Frame;
+ $f->Button(-text => $text{'ok'},
+ -command => sub { $val = $entry->get; callback_edit_directories($key,$val) ; $sw->destroy })->pack(-side => 'left');
+ $f->Button(-text => $text{'cancel'},
+ -command => sub { $sw->destroy })->pack(-side => 'right');
+ $f->pack(-expand => 'x');
+}
+
+sub menu_select_scheme {
+ my $sw = $mw->Toplevel(-title => $labels{'scheme'});
+ my @schemes;
+ foreach my $pkg ($tlpdb->list_packages) {
+ my $tlpobj = $tlpdb->{'tlps'}{$pkg};
+ if ($tlpobj->category eq "Scheme") {
+ push @schemes, $pkg;
+ $vars{"$pkg"}=($vars{'selected_scheme'} eq $pkg)? 1:0;
+ }
+ }
+ @schemes=sort @schemes;
+ my $selected = $vars{'selected_scheme'};
+ $sw->Label(-text => $text{'selectscheme'})->pack;
+ my $f2 = $sw->Frame;
+ my $f2l = $f2->Frame;
+ my $f2r = $f2->Frame;
+ my $nrfh = $#schemes / 2;
+ my $i = 0;
+ foreach my $scheme (@schemes) {
+ my $tlpobj = $tlpdb->get_package("$scheme");
+ if ($i < $nrfh) {
+ $f2l->Radiobutton(-variable => \$selected, -value => $scheme,
+ -text => $tlpobj->shortdesc)->pack(-anchor => 'w');
+ } else {
+ $f2r->Radiobutton(-variable => \$selected, -value => $scheme,
+ -text => $tlpobj->shortdesc)->pack(-anchor => 'w');
+ }
+ $i++;
+ }
+ $f2l->pack(-side => 'left');
+ $f2r->pack(-side => 'right');
+ $f2->pack;
+ my $f3 = $sw->Frame;
+ $f3->Button(-text => $text{'ok'},
+ -command => sub { callback_select_scheme($selected) ; $sw->destroy })->pack(-side => 'left');
+ $f3->Button(-text => $text{'cancel'},
+ -command => sub { $sw->destroy })->pack(-side => 'right');
+ $f3->pack(-expand => 'x');
+}
+
+sub menu_select_standard_collections {
+ my $sw = $mw->Toplevel(-title => $label{'stdcoll'});
+ my $fb = $sw->Frame;
+ my $fc = $sw->Frame;
+ my $fd = $sw->Frame;
+ my $f1 = $fb->Frame;
+ my $f2 = $fb->Frame;
+ my %lvars = %vars;
+ $sw->Label(-text => $text{'selectstdcol'})->pack;
+ my $halfcol = $#collections_std / 2;
+ my $i = 0;
+ foreach my $coll (sort @collections_std) {
+ my $tlpobj = $tlpdb->get_package("$coll");
+ if ($i < $halfcol) {
+ $f1->Checkbutton(-variable => \$lvars{$coll}, -text => $tlpobj->shortdesc)->pack(-anchor => 'w');
+ } else {
+ $f2->Checkbutton(-variable => \$lvars{$coll}, -text => $tlpobj->shortdesc)->pack(-anchor => 'w');
+ }
+ $i++;
+ }
+ $f1->pack(-side => 'left');
+ $f2->pack(-side => 'right');
+ $fb->pack;
+ $fd->pack(-expand => 'x');
+ $fd->Button(-text => $text{'selectall'},
+ -command => sub { select_collections(\%lvars, @collections_std) })->pack(-side => 'left');
+ $fd->Button(-text => $text{'selectnone'},
+ -command => sub { deselect_collections(\%lvars, @collections_std) })->pack(-side => 'right');
+ $fc->pack(-expand => 'x');
+ $fc->Button(-text => $text{'ok'},
+ -command => sub { %vars = %lvars; callback_select_collection() ; $sw->destroy })->pack(-side => 'left');
+ $fc->Button(-text => $text{'cancel'},
+ -command => sub { $sw->destroy })->pack(-side => 'right');
+}
+
+sub menu_select_lang_collections {
+ my $sw = $mw->Toplevel(-title => $label{'langcoll'});
+ my $f1 = $sw->Frame;
+ $f1->pack;
+ my $f1lang = $f1->Frame;
+ my $f1doc = $f1->Frame;
+ $f1lang->pack(-side => 'left');
+ $f1doc->pack(-side => 'right');
+ my $f1langT = $f1lang->Frame; $f1langT->pack;
+ my $f1langL = $f1lang->Frame; $f1langL->pack;
+ $f1langT->Label(-text => $text{'selectlang'})->pack;
+ my $f1langLa = $f1langL->Frame; $f1langLa->pack(-side => 'left');
+ my $f1langLb = $f1langL->Frame; $f1langLb->pack(-side => 'right');
+ my $langh = $#collections_lang / 2;
+ my $i = 0;
+ my %lvars = %vars;
+ foreach my $coll (sort @collections_lang) {
+ my $tlpobj = $tlpdb->get_package("$coll");
+ if ($i < $langh) {
+ $f1langLa->Checkbutton(-variable => \$lvars{$coll}, -text => $tlpobj->shortdesc)->pack(-anchor => 'w');
+ } else {
+ $f1langLb->Checkbutton(-variable => \$lvars{$coll}, -text => $tlpobj->shortdesc)->pack(-anchor => 'w');
+ }
+ $i++;
+ }
+ my $f1langB = $f1lang->Frame;
+ $f1langB->pack(-expand => 'x');
+ $f1langB->Button(-text => $text{'selectall'},
+ -command => sub { select_collections(\%lvars, @collections_lang) })->pack(-side => 'left');
+ $f1langB->Button(-text => $text{'selectnone'},
+ -command => sub { deselect_collections(\%lvars, @collections_lang) })->pack(-side => 'right');
+
+ my $f1docT = $f1doc->Frame; $f1docT->pack;
+ my $f1docL = $f1doc->Frame; $f1docL->pack;
+ $f1docT->Label(-text => $text{'selectdoc'})->pack;
+ my $f1docLa = $f1docL->Frame; $f1docLa->pack(-side => 'left');
+ my $f1docLb = $f1docL->Frame; $f1docLb->pack(-side => 'right');
+ my $doch = $#collections_lang_doc / 2;
+ $i = 0;
+ foreach my $coll (sort @collections_lang_doc) {
+ my $tlpobj = $tlpdb->get_package("$coll");
+ if ($i < $doch) {
+ $f1docLa->Checkbutton(-variable => \$lvars{$coll}, -text => $tlpobj->shortdesc)->pack(-anchor => 'w');
+ } else {
+ $f1docLb->Checkbutton(-variable => \$lvars{$coll}, -text => $tlpobj->shortdesc)->pack(-anchor => 'w');
+ }
+ $i++;
+ }
+ my $f1docB = $f1doc->Frame;
+ $f1docB->pack(-expand => 'x');
+ $f1docB->Button(-text => $text{'selectall'},
+ -command => sub { select_collections(\%lvars, @collections_lang_doc) })->pack(-side => 'left');
+ $f1docB->Button(-text => $text{'selectnone'},
+ -command => sub { deselect_collections(\%lvars, @collections_lang_doc) })->pack(-side => 'right');
+ my $f2 = $sw->Frame; $f2->pack(-expand => 'x');
+ $f2->Button(-text => $text{'ok'},
+ -command => sub { %vars = %lvars; callback_select_collection() ; $sw->destroy })->pack(-side => 'left');
+ $f2->Button(-text => $text{'cancel'},
+ -command => sub { $sw->destroy })->pack(-side => 'right');
+}
+
+sub menu_select_symlink {
+ our ($lbin,$lman,$linfo);
+ our $osym = $vars{'option_symlinks'};
+ sub set_unset_buttons {
+ $lbin = ($osym ? $vars{'sys_bin'} : '');
+ $linfo = ($osym ? $vars{'sys_info'} : '');
+ $lman = ($osym ? $vars{'sys_man'} : '');
+ }
+ sub return_callback {
+ if ($osym) {
+ $vars{'sys_bin'} = $lbin;
+ $vars{'sys_info'} = $linfo;
+ $vars{'sys_man'} = $lman;
+ }
+ $vars{'option_symlinks'} = $osym;
+ menu_update_texts();
+ }
+ set_unset_buttons();
+ my $sw = $mw->Toplevel(-title => $label{'symlink'});
+ $sw->Checkbutton(-variable => \$osym,
+ -text => $text{'createsym'},
+ -command => sub { set_unset_buttons(); } )->pack;
+ my $fbin = $sw->Frame;
+ $fbin->Label(-text => $text{'binto'})->pack(-side => 'left');
+ my $binb = $fbin->Entry(-textvariable => \$lbin, -width => 30);
+ $binb->pack(-side => 'right');
+ $fbin->pack(-expand => 'x');
+ my $fman = $sw->Frame;
+ $fman->Label(-text => $text{'manto'})->pack(-side => 'left');
+ my $manb = $fman->Entry(-textvariable => \$lman, -width => 30);
+ $manb->pack(-side => 'right');
+ $fman->pack(-expand => 'x');
+ my $finfo = $sw->Frame;
+ $finfo->Label(-text => $text{'infoto'})->pack(-side => 'left');
+ my $infob = $finfo->Entry(-textvariable => \$linfo, -width => 30);
+ $infob->pack(-side => 'right');
+ $finfo->pack(-expand => 'x');
+ my $f2 = $sw->Frame; $f2->pack(-expand => 'x');
+ $f2->Button(-text => $text{'ok'},
+ -command => sub { return_callback(); $sw->destroy })->pack(-side => 'left');
+ $f2->Button(-text => $text{'cancel'},
+ -command => sub { $sw->destroy })->pack(-side => 'right');
+}
+
+sub menu_select_binsystems {
+ our $f2r;
+ our $f2;
+ our @netarchs = ();
+ sub update_net_archs() {
+ my $oldnrnetarch = $#netarchs;
+ $trynet = 1;
+ set_platforms_supported();
+ $trynet=0;
+ @netarchs = ();
+ foreach my $key (keys %vars) {
+ if ($key=~/netbin_(.*)/) {
+ push @netarchs, $1;
+ $from_net{"$1"}=1;
+ }
+ }
+ menu_update_texts();
+ if ($#netarchs != $oldnrnetarch) {
+ # we have to destroy the old $f2r frame and make a new one
+ $f2r->destroy;
+ do_net_frame();
+ }
+ }
+ sub do_net_frame {
+ $f2r = $f2->Frame;
+ if ($#netarchs >= 0) {
+ $f2r->Label(-text => $text{'onnet'})->pack;
+ foreach my $sys (sort @netarchs) {
+ $f2r->Checkbutton(-variable => \$vars{"netbin_$sys"}, -text => "$sys")->pack(-anchor => 'w');
+ }
+ $f2r->pack(-side => 'right');
+ }
+ $f2->pack;
+ }
+ my $sw = $mw->Toplevel(-title => $label{'binsys'});
+ my @diskarchs = ();
+ foreach my $key (keys %vars) {
+ if ($key=~/diskbin_(.*)/) {
+ push @diskarchs, $1;
+ $from_net{"$1"}=0;
+ }
+ if ($key=~/netbin_(.*)/) {
+ push @netarchs, $1;
+ $from_net{"$1"}=1;
+ }
+ }
+ $sw->Label(-text => $text{'selectsys'})->pack;
+ $f2 = $sw->Frame;
+ my $f2l = $f2->Frame;
+ $f2l->Label(-text => $text{'ondisk'})->pack;
+ foreach my $sys (sort @diskarchs) {
+ $f2l->Checkbutton(-variable => \$vars{"diskbin_$sys"}, -text => platform_desc($sys))->pack(-anchor => 'w');
+ }
+ $f2l->pack(-side => 'left');
+ do_net_frame();
+ my $f4 = $sw->Frame;
+ $f4->pack;
+ $f4->Button(-text => $text{'clicknetbin'},
+ -command => sub { update_net_archs(); })->pack;
+ my $f3 = $sw->Frame;
+ $f3->Button(-text => $text{'ok'},
+ -command => sub { callback_select_systems() ; $sw->destroy })->pack(-side => 'left');
+ $f3->Button(-text => $text{'cancel'},
+ -command => sub { $sw->destroy })->pack(-side => 'right');
+ $f3->pack(-expand => 'x');
+}
+
+
+sub menu_set_text {
+ my $w = shift;
+ my $t = shift;
+ $w->configure(-text => $t);
+}
+
+sub menu_set_symlink_text {
+ menu_set_text($symlinktext, (($vars{'option_symlinks'})?$text{'yes'}:$text{'no'}));
+}
+
+sub menu_set_schemebutton_text {
+ menu_set_text($schemebutton, "$vars{'selected_scheme'}");
+}
+
+sub menu_set_binbutton_text {
+ menu_set_text($bintextbutton, "$vars{'n_systems_selected'} $text{'outof'} $vars{'n_systems_available'}");
+}
+
+sub menu_set_collections_text {
+ menu_set_text($collectionstext, "$vars{'n_collections_selected'} $text{'collof'} $vars{'n_collections_available'}, $text{'diskreq'}: $vars{'total_size'} MB");
+}
+
+sub menu_set_pathes_text {
+ menu_set_text($texdirtext, "$vars{'TEXDIR'}");
+ menu_set_text($texmflocaltext, "$vars{'TEXMFLOCAL'}");
+ menu_set_text($texmfsysvartext, "$vars{'TEXMFSYSVAR'}");
+}
+
+
+sub menu_update_texts {
+ menu_set_pathes_text;
+ menu_set_collections_text;
+ menu_set_binbutton_text;
+ menu_set_schemebutton_text;
+ $optletterstate = ($vars{'option_letter'} ? $text{'yes'} : $text{'no'});
+ $optfmtstate = ($vars{'option_fmt'} ? $text{'yes'} : $text{'no'});
+ $optsrcstate = ($vars{'option_src'} ? $text{'yes'} : $text{'no'});
+ $optdocstate = ($vars{'option_doc'} ? $text{'yes'} : $text{'no'});
+ if (unix()) { menu_set_symlink_text; };
+}
+
+sub callback_select_scheme {
+ my $s = shift;
+ select_scheme($s);
+ menu_update_texts();
+}
+
+sub callback_select_collection {
+ calc_depends();
+ update_numbers();
+ menu_update_texts();
+}
+
+sub callback_select_systems() {
+ calc_depends();
+ update_numbers();
+ menu_update_texts();
+}
+
+sub callback_edit_directories {
+ my ($key,$val) = @_;
+ $vars{$key} = $val;
+ if ($vars{'TEXDIR'}=~/^(.*)\/$texlive_release$/) {
+ $vars{'TEXMFLOCAL'}="$1/texmf-local";
+ $vars{'TEXMFSYSVAR'}="$1/$texlive_release/texmf-var";
+ } elsif ($vars{'TEXDIR'}=~/^(.*)$/) {
+ $vars{'TEXMFLOCAL'}="$1/texmf-local";
+ $vars{'TEXMFSYSVAR'}="$1/texmf-var";
+ }
+ menu_update_texts();
+}
+
+sub callback_edit_var() {
+ my ($key,$val) = @_;
+ $vars{$key} = $val;
+ menu_update_texts();
+}
+
+sub dump_vars_stdout {
+ foreach my $k (keys %vars) {
+ print "DEBUG: vars{$k} = $vars{$k}\n";
+ }
+}
+
+sub select_collections {
+ my $varref = shift;
+ foreach (@_) {
+ $varref->{$_} = 1;
+ }
+}
+
+sub deselect_collections {
+ my $varref = shift;
+ foreach (@_) {
+ $varref->{$_} = 0;
+ }
+}
+
+sub toggle_and_set_opt_variable {
+ my ($varsref, $toggleref) = @_;
+ $$toggleref = ($$toggleref eq $text{'yes'}) ? $text{'no'} : $text{'yes'};
+ $$varsref = 0;
+ $$varsref = 1 if ($$toggleref eq $text{'yes'});
+ menu_update_texts();
+}
+
+1;
+
+__END__
+
+### Local Variables:
+### perl-indent-level: 2
+### tab-width: 2
+### indent-tabs-mode: nil
+### End:
+# vim:set tabstop=2 expandtab: #
+
diff --git a/Master/tlpkg/installer/install-menu-perltk.pl.old b/Master/tlpkg/installer/install-menu-perltk.pl.old
new file mode 100644
index 00000000000..d9b96e2575b
--- /dev/null
+++ b/Master/tlpkg/installer/install-menu-perltk.pl.old
@@ -0,0 +1,524 @@
+#!/usr/bin/env perl
+#
+# $Id$
+#
+# Copyright 2008 Norbert Preining, Reinhard Kotucha
+# This file is licensed under the GNU General Public License version 2
+# or any later version.
+#
+#
+# MISSING SUPPORT FOR:
+# - TEXMFHOME ???
+#
+# TODO:
+# - 'cancel' in the collections/scheme dialogs is not really a cancel because
+# the checkboxes are tied to the %vars hash, which make cancel == return!!!
+# - does the DoOneEvent *NEVER* hang???
+
+our %vars;
+our $tlpdb;
+our @collections_std;
+our @collections_lang;
+our @collections_lang_doc;
+our $texlive_release;
+our $trynet;
+our $max_bins_on_CD;
+
+our $MENU_INSTALL = 0;
+our $MENU_ABORT = 1;
+our $MENU_QUIT = 2;
+our $MENU_ALREADYDONE = 3;
+
+my $return = $MENU_INSTALL;
+
+require Tk;
+require Tk::Dialog;
+
+my $mw;
+
+my $bintextbutton;
+my $schemebutton;
+my $collectionstext;
+my $texmflocaltext;
+my $texmfsysvartext;
+my $texdirtext;
+my $symlinktext;
+
+push @::start_install_hook, sub { update_statusbar("Starting Installation");
+ Tk::DoOneEvent(Tk::Event::DONT_WAIT); Tk::DoOneEvent(Tk::Event::DONT_WAIT); };
+push @::start_postinst_hook, sub { update_statusbar("Starting Post Installation Jobs");
+ Tk::DoOneEvent(Tk::Event::DONT_WAIT); Tk::DoOneEvent(Tk::Event::DONT_WAIT); };
+push @::end_install_hook, sub { update_statusbar("Installation finished");
+ Tk::DoOneEvent(Tk::Event::DONT_WAIT); Tk::DoOneEvent(Tk::Event::DONT_WAIT); };
+
+
+push @::install_packages_hook, \&update_statusbar;
+# no idea how many of those are necessary, 1 is definitely not enough!
+push @::install_packages_hook, sub { Tk::DoOneEvent(Tk::Event::DONT_WAIT); };
+push @::install_packages_hook, sub { Tk::DoOneEvent(Tk::Event::DONT_WAIT); };
+push @::install_packages_hook, sub { Tk::DoOneEvent(Tk::Event::DONT_WAIT); };
+push @::install_packages_hook, sub { Tk::DoOneEvent(Tk::Event::DONT_WAIT); };
+push @::install_packages_hook, sub { Tk::DoOneEvent(Tk::Event::DONT_WAIT); };
+push @::install_packages_hook, sub { Tk::DoOneEvent(Tk::Event::DONT_WAIT); };
+push @::install_packages_hook, sub { Tk::DoOneEvent(Tk::Event::DONT_WAIT); };
+push @::install_packages_hook, sub { Tk::DoOneEvent(Tk::Event::DONT_WAIT); };
+push @::install_packages_hook, sub { Tk::DoOneEvent(Tk::Event::DONT_WAIT); };
+push @::install_packages_hook, sub { Tk::DoOneEvent(Tk::Event::DONT_WAIT); };
+push @::install_packages_hook, sub { Tk::DoOneEvent(Tk::Event::DONT_WAIT); };
+push @::install_packages_hook, sub { Tk::DoOneEvent(Tk::Event::DONT_WAIT); };
+push @::install_packages_hook, sub { Tk::DoOneEvent(Tk::Event::DONT_WAIT); };
+push @::install_packages_hook, sub { Tk::DoOneEvent(Tk::Event::DONT_WAIT); };
+push @::install_packages_hook, sub { Tk::DoOneEvent(Tk::Event::DONT_WAIT); };
+push @::install_packages_hook, sub { Tk::DoOneEvent(Tk::Event::DONT_WAIT); };
+
+sub update_statusbar {
+ my $p = shift;
+ $::statusbar->configure(-text => "$p");
+}
+
+sub run_menu {
+ calc_depends;
+ $mw = MainWindow->new;
+ my $f0 = $mw->Frame;
+ my $fl = $f0->Frame;
+ my $fr = $f0->Frame;
+ $f0->pack;
+ $fl->pack(-side => 'left');
+ $fr->pack(-side => 'right');
+ my $img = $fl->Pixmap(-file => "install-tl.xpm");
+ $fl->Label(-image => $img)->pack;
+ $fr->Label(-text => 'TeX Live 2008 Installation')->pack;
+ $bintextbutton = $fr->Button(
+ -command => sub { menu_select_binsystems(); }
+ );
+ $bintextbutton->pack;
+ $schemebutton = $fr->Button(
+ -command => sub { menu_select_scheme(); }
+ );
+ $schemebutton->pack;
+ $fr->Label(-text => 'Customizing installation scheme')->pack;
+ $fr->Button(
+ -text => "Standard Collections",
+ -command => sub { menu_select_standard_collections(); }
+ )->pack;
+ $fr->Button(
+ -text => "Language Collections",
+ -command => sub { menu_select_lang_collections(); }
+ )->pack;
+ $collectionstext = $fr->Label();
+ $collectionstext->pack;
+ #$fr->Button(
+ # -text => "Directories' setup",
+ # -command => sub { notimpl(); }
+ #)->pack;
+ $fr->Label(-text => "Directories' setup")->pack;
+ $texdirtext = $fr->Button(
+ -command => sub { menu_edit_vars_value("TEXDIR"); } );
+ $texmflocaltext = $fr->Button(
+ -command => sub { menu_edit_vars_value("TEXMFLOCAL"); } );
+ $texmfsysvartext = $fr->Button(
+ -command => sub { menu_edit_vars_value("TEXMFSYSVAR"); } );
+ $texdirtext->pack;
+ $texmflocaltext->pack;
+ $texmfsysvartext->pack;
+ $fr->Checkbutton(-variable => \$vars{'option_letter'}, -text => "use letter size instead of A4 by default")->pack;
+ $fr->Checkbutton(-variable => \$vars{'option_fmt'}, -text => "create all format files")->pack;
+ $fr->Checkbutton(-variable => \$vars{'option_doc'}, -text => "install font/macro doc tree")->pack;
+ $fr->Checkbutton(-variable => \$vars{'option_src'}, -text => "install font/macro source tree")->pack;
+ if (unix()) {
+ $symlinktext = $fr->Button(-command => sub { menu_select_symlink(); })->pack;
+ }
+ my $f3 = $fr->Frame;
+ $f3->Button(
+ -text => 'Install TeX Live',
+ -command => sub { do_installation();
+ $return = $MENU_ALREADYDONE;
+ $fr->Dialog(-text => 'Installation finished', -buttons => [qw/Finish/])->Show;
+ $mw->destroy },
+ )->pack(-side => 'left');
+ $f3->Button(
+ -text => 'Quit',
+ -command => sub { exit 0; $return = $MENU_ABORT; $mw->destroy }
+ )->pack(-side => 'right');
+ $f3->pack(-expand => 'x');
+ $::statusbar = $mw->Label(-text => 'Status output');
+ $::statusbar->pack;
+ menu_update_texts();
+ Tk::MainLoop();
+ return($return);
+}
+
+sub notimpl {
+ my $errorwin = $mw->Toplevel;
+ $errorwin->Button(-text => "Not implemented yet!",
+ -command => [ $errorwin => 'destroy' ])->pack;
+}
+
+sub menu_edit_vars_value {
+ my $key = shift;
+ my $sw = $mw->Toplevel;
+ my $val = $vars{$key};
+ $sw->Label(-text => "Enter path for $key:")->pack;
+ my $entry = $sw->Entry(-textvariable => $val, -width => 60);
+ $entry->pack;
+ my $f = $sw->Frame;
+ $f->Button(-text => "Ok",
+ -command => sub { $val = $entry->get; callback_edit_directories($key,$val) ; $sw->destroy })->pack(-side => 'left');
+ $f->Button(-text => "Cancel",
+ -command => sub { $sw->destroy })->pack(-side => 'right');
+ $f->pack(-expand => 'x');
+}
+
+sub menu_select_scheme {
+ my $sw = $mw->Toplevel;
+ my @schemes;
+ foreach my $pkg ($tlpdb->list_packages) {
+ my $tlpobj = $tlpdb->{'tlps'}{$pkg};
+ if ($tlpobj->category eq "Scheme") {
+ push @schemes, $pkg;
+ $vars{"$pkg"}=($vars{'selected_scheme'} eq $pkg)? 1:0;
+ }
+ }
+ @schemes=sort @schemes;
+ my $selected = $vars{'selected_scheme'};
+ $sw->Label(-text => 'Select Scheme')->pack;
+ my $f2 = $sw->Frame;
+ my $f2l = $f2->Frame;
+ my $f2r = $f2->Frame;
+ my $nrfh = $#schemes / 2;
+ my $i = 0;
+ foreach my $scheme (@schemes) {
+ my $tlpobj = $tlpdb->get_package("$scheme");
+ if ($i < $nrfh) {
+ $f2l->Radiobutton(-variable => \$selected, -value => $scheme,
+ -text => $tlpobj->shortdesc)->pack(-anchor => 'w');
+ } else {
+ $f2r->Radiobutton(-variable => \$selected, -value => $scheme,
+ -text => $tlpobj->shortdesc)->pack(-anchor => 'w');
+ }
+ $i++;
+ }
+ $f2l->pack(-side => 'left');
+ $f2r->pack(-side => 'right');
+ $f2->pack;
+ my $f3 = $sw->Frame;
+ $f3->Button(-text => "Return",
+ -command => sub { callback_select_scheme($selected) ; $sw->destroy })->pack(-side => 'left');
+ $f3->Button(-text => "Cancel",
+ -command => sub { $sw->destroy })->pack(-side => 'right');
+ $f3->pack(-expand => 'x');
+}
+
+sub menu_select_standard_collections {
+ my $sw = $mw->Toplevel;
+ my $fb = $sw->Frame;
+ my $fc = $sw->Frame;
+ my $fd = $sw->Frame;
+ my $f1 = $fb->Frame;
+ my $f2 = $fb->Frame;
+ my %lvars = %vars;
+ $sw->Label(-text => 'Select the collections to be installed')->pack;
+ my $halfcol = $#collections_std / 2;
+ my $i = 0;
+ foreach my $coll (sort @collections_std) {
+ my $tlpobj = $tlpdb->get_package("$coll");
+ if ($i < $halfcol) {
+ $f1->Checkbutton(-variable => \$lvars{$coll}, -text => $tlpobj->shortdesc)->pack(-anchor => 'w');
+ } else {
+ $f2->Checkbutton(-variable => \$lvars{$coll}, -text => $tlpobj->shortdesc)->pack(-anchor => 'w');
+ }
+ $i++;
+ }
+ $f1->pack(-side => 'left');
+ $f2->pack(-side => 'right');
+ $fb->pack;
+ $fd->pack(-expand => 'x');
+ $fd->Button(-text => "Select all",
+ -command => sub { select_collections(\%lvars, @collections_std) })->pack(-side => 'left');
+ $fd->Button(-text => "Deselect all",
+ -command => sub { deselect_collections(\%lvars, @collections_std) })->pack(-side => 'right');
+ $fc->pack(-expand => 'x');
+ $fc->Button(-text => "Return",
+ -command => sub { %vars = %lvars; callback_select_collection() ; $sw->destroy })->pack(-side => 'left');
+ $fc->Button(-text => "Cancel",
+ -command => sub { $sw->destroy })->pack(-side => 'right');
+}
+
+sub menu_select_lang_collections {
+ my $sw = $mw->Toplevel;
+ my $f1 = $sw->Frame;
+ $f1->pack;
+ my $f1lang = $f1->Frame;
+ my $f1doc = $f1->Frame;
+ $f1lang->pack(-side => 'left');
+ $f1doc->pack(-side => 'right');
+ my $f1langT = $f1lang->Frame; $f1langT->pack;
+ my $f1langL = $f1lang->Frame; $f1langL->pack;
+ $f1langT->Label(-text => 'Language Selection')->pack;
+ my $f1langLa = $f1langL->Frame; $f1langLa->pack(-side => 'left');
+ my $f1langLb = $f1langL->Frame; $f1langLb->pack(-side => 'right');
+ my $langh = $#collections_lang / 2;
+ my $i = 0;
+ my %lvars = %vars;
+ foreach my $coll (sort @collections_lang) {
+ my $tlpobj = $tlpdb->get_package("$coll");
+ if ($i < $langh) {
+ $f1langLa->Checkbutton(-variable => \$lvars{$coll}, -text => $tlpobj->shortdesc)->pack(-anchor => 'w');
+ } else {
+ $f1langLb->Checkbutton(-variable => \$lvars{$coll}, -text => $tlpobj->shortdesc)->pack(-anchor => 'w');
+ }
+ $i++;
+ }
+ my $f1langB = $f1lang->Frame;
+ $f1langB->pack(-expand => 'x');
+ $f1langB->Button(-text => "Select all",
+ -command => sub { select_collections(\%lvars, @collections_lang) })->pack(-side => 'left');
+ $f1langB->Button(-text => "Deselect all",
+ -command => sub { deselect_collections(\%lvars, @collections_lang) })->pack(-side => 'right');
+
+ my $f1docT = $f1doc->Frame; $f1docT->pack;
+ my $f1docL = $f1doc->Frame; $f1docL->pack;
+ $f1docT->Label(-text => 'Doc/Language Selection')->pack;
+ my $f1docLa = $f1docL->Frame; $f1docLa->pack(-side => 'left');
+ my $f1docLb = $f1docL->Frame; $f1docLb->pack(-side => 'right');
+ my $doch = $#collections_lang_doc / 2;
+ $i = 0;
+ foreach my $coll (sort @collections_lang_doc) {
+ my $tlpobj = $tlpdb->get_package("$coll");
+ if ($i < $doch) {
+ $f1docLa->Checkbutton(-variable => \$lvars{$coll}, -text => $tlpobj->shortdesc)->pack(-anchor => 'w');
+ } else {
+ $f1docLb->Checkbutton(-variable => \$lvars{$coll}, -text => $tlpobj->shortdesc)->pack(-anchor => 'w');
+ }
+ $i++;
+ }
+ my $f1docB = $f1doc->Frame;
+ $f1docB->pack(-expand => 'x');
+ $f1docB->Button(-text => "Select all",
+ -command => sub { select_collections(\%lvars, @collections_lang_doc) })->pack(-side => 'left');
+ $f1docB->Button(-text => "Deselect all",
+ -command => sub { deselect_collections(\%lvars, @collections_lang_doc) })->pack(-side => 'right');
+ my $f2 = $sw->Frame; $f2->pack(-expand => 'x');
+ $f2->Button(-text => "Return",
+ -command => sub { %vars = %lvars; callback_select_collection() ; $sw->destroy })->pack(-side => 'left');
+ $f2->Button(-text => "Cancel",
+ -command => sub { $sw->destroy })->pack(-side => 'right');
+}
+
+sub menu_select_symlink {
+ our ($lbin,$lman,$linfo);
+ our $osym = $vars{'option_symlinks'};
+ sub set_unset_buttons {
+ $lbin = ($osym ? $vars{'sys_bin'} : '');
+ $linfo = ($osym ? $vars{'sys_info'} : '');
+ $lman = ($osym ? $vars{'sys_man'} : '');
+ }
+ sub return_callback {
+ if ($osym) {
+ $vars{'sys_bin'} = $lbin;
+ $vars{'sys_info'} = $linfo;
+ $vars{'sys_man'} = $lman;
+ }
+ $vars{'option_symlinks'} = $osym;
+ menu_update_texts();
+ }
+ set_unset_buttons();
+ my $sw = $mw->Toplevel;
+ $sw->Checkbutton(-variable => \$osym,
+ -text => 'create symlinks in standard directories',
+ -command => sub { set_unset_buttons(); } )->pack;
+ my $fbin = $sw->Frame;
+ $fbin->Label(-text => 'binaries to: ')->pack(-side => 'left');
+ my $binb = $fbin->Entry(-textvariable => \$lbin, -width => 30);
+ $binb->pack(-side => 'right');
+ $fbin->pack(-expand => 'x');
+ my $fman = $sw->Frame;
+ $fman->Label(-text => 'manpages to: ')->pack(-side => 'left');
+ my $manb = $fman->Entry(-textvariable => \$lman, -width => 30);
+ $manb->pack(-side => 'right');
+ $fman->pack(-expand => 'x');
+ my $finfo = $sw->Frame;
+ $finfo->Label(-text => 'info to: ')->pack(-side => 'left');
+ my $infob = $finfo->Entry(-textvariable => \$linfo, -width => 30);
+ $infob->pack(-side => 'right');
+ $finfo->pack(-expand => 'x');
+ my $f2 = $sw->Frame; $f2->pack(-expand => 'x');
+ $f2->Button(-text => "Return",
+ -command => sub { return_callback(); $sw->destroy })->pack(-side => 'left');
+ $f2->Button(-text => "Cancel",
+ -command => sub { $sw->destroy })->pack(-side => 'right');
+}
+
+sub menu_select_binsystems {
+ our $f2r;
+ our $f2;
+ our @netarchs = ();
+ sub update_net_archs() {
+ my $oldnrnetarch = $#netarchs;
+ $trynet = 1;
+ set_platforms_supported();
+ $trynet=0;
+ @netarchs = ();
+ foreach my $key (keys %vars) {
+ if ($key=~/netbin_(.*)/) {
+ push @netarchs, $1;
+ $from_net{"$1"}=1;
+ }
+ }
+ menu_update_texts();
+ if ($#netarchs != $oldnrnetarch) {
+ # we have to destroy the old $f2r frame and make a new one
+ $f2r->destroy;
+ do_net_frame();
+ }
+ }
+ sub do_net_frame {
+ $f2r = $f2->Frame;
+ if ($#netarchs >= 0) {
+ $f2r->Label(-text => 'On Net')->pack;
+ foreach my $sys (sort @netarchs) {
+ $f2r->Checkbutton(-variable => \$vars{"netbin_$sys"}, -text => "$sys")->pack(-anchor => 'w');
+ }
+ $f2r->pack(-side => 'right');
+ }
+ $f2->pack;
+ }
+ my $sw = $mw->Toplevel;
+ my @diskarchs = ();
+ foreach my $key (keys %vars) {
+ if ($key=~/diskbin_(.*)/) {
+ push @diskarchs, $1;
+ $from_net{"$1"}=0;
+ }
+ if ($key=~/netbin_(.*)/) {
+ push @netarchs, $1;
+ $from_net{"$1"}=1;
+ }
+ }
+ $sw->Label(-text => 'Select arch/os')->pack;
+ $f2 = $sw->Frame;
+ my $f2l = $f2->Frame;
+ $f2l->Label(-text => 'On Disk')->pack;
+ foreach my $sys (sort @diskarchs) {
+ $f2l->Checkbutton(-variable => \$vars{"diskbin_$sys"}, -text => platform_desc($sys))->pack(-anchor => 'w');
+ }
+ $f2l->pack(-side => 'left');
+ do_net_frame();
+ my $f4 = $sw->Frame;
+ $f4->pack;
+ $f4->Button(-text => 'Click for net bins',
+ -command => sub { update_net_archs(); })->pack;
+ my $f3 = $sw->Frame;
+ $f3->Button(-text => "Return",
+ -command => sub { callback_select_systems() ; $sw->destroy })->pack(-side => 'left');
+ $f3->Button(-text => "Cancel",
+ -command => sub { $sw->destroy })->pack(-side => 'right');
+ $f3->pack(-expand => 'x');
+}
+
+
+sub menu_set_text {
+ my $w = shift;
+ my $t = shift;
+ $w->configure(-text => $t);
+}
+
+sub menu_set_symlink_text {
+ menu_set_text($symlinktext, "Install symlinks: " . (($vars{'option_symlinks'})?"Yes":"No"));
+}
+
+sub menu_set_schemebutton_text {
+ menu_set_text($schemebutton, "Selected Scheme: $vars{'selected_scheme'}");
+}
+
+sub menu_set_binbutton_text {
+ menu_set_text($bintextbutton, "Binary Systems $vars{'n_systems_selected'} out of $vars{'n_systems_available'}");
+}
+
+sub menu_set_collections_text {
+ menu_set_text($collectionstext, "$vars{'n_collections_selected'} collections out of $vars{'n_collections_available'}, disk space required: $vars{'total_size'} MB");
+}
+
+sub menu_set_pathes_text {
+ menu_set_text($texdirtext, "TEXDIR (The main TeX directory): $vars{'TEXDIR'}");
+ menu_set_text($texmflocaltext, "TEXMFLOCAL (Directory for local styles etc): $vars{'TEXMFLOCAL'}");
+ menu_set_text($texmfsysvartext, "TEXMFSYSVAR (Directory for local config): $vars{'TEXMFSYSVAR'}");
+}
+
+
+sub menu_update_texts {
+ menu_set_pathes_text;
+ menu_set_collections_text;
+ menu_set_binbutton_text;
+ menu_set_schemebutton_text;
+ if (unix()) { menu_set_symlink_text; };
+}
+
+sub callback_select_scheme {
+ my $s = shift;
+ select_scheme($s);
+ menu_update_texts();
+}
+
+sub callback_select_collection {
+ calc_depends();
+ update_numbers();
+ menu_update_texts();
+}
+
+sub callback_select_systems() {
+ calc_depends();
+ update_numbers();
+ menu_update_texts();
+}
+
+sub callback_edit_directories {
+ my ($key,$val) = @_;
+ $vars{$key} = $val;
+ if ($vars{'TEXDIR'}=~/^(.*)\/$texlive_release$/) {
+ $vars{'TEXMFLOCAL'}="$1/texmf-local";
+ $vars{'TEXMFSYSVAR'}="$1/$texlive_release/texmf-var";
+ } elsif ($vars{'TEXDIR'}=~/^(.*)$/) {
+ $vars{'TEXMFLOCAL'}="$1/texmf-local";
+ $vars{'TEXMFSYSVAR'}="$1/texmf-var";
+ }
+ menu_update_texts();
+}
+
+sub callback_edit_var() {
+ my ($key,$val) = @_;
+ $vars{$key} = $val;
+ menu_update_texts();
+}
+
+sub dump_vars_stdout {
+ foreach my $k (keys %vars) {
+ print "DEBUG: vars{$k} = $vars{$k}\n";
+ }
+}
+
+sub select_collections {
+ my $varref = shift;
+ foreach (@_) {
+ $varref->{$_} = 1;
+ }
+}
+
+sub deselect_collections {
+ my $varref = shift;
+ foreach (@_) {
+ $varref->{$_} = 0;
+ }
+}
+
+1;
+
+__END__
+
+### Local Variables:
+### perl-indent-level: 2
+### tab-width: 2
+### indent-tabs-mode: nil
+### End:
+# vim:set tabstop=2 expandtab: #
+
diff --git a/Master/tlpkg/installer/install-menu-text.pl b/Master/tlpkg/installer/install-menu-text.pl
new file mode 100755
index 00000000000..3c3719096d1
--- /dev/null
+++ b/Master/tlpkg/installer/install-menu-text.pl
@@ -0,0 +1,836 @@
+#!/usr/bin/env perl
+
+# $Id$
+# install-menu-txt.pl
+#
+# Copyright 2007 Reinhard Kotucha, Norbert Preining
+# This file is licensed under the GNU General Public License version 2
+# or any later version.
+#
+# This file implements the text based menu system for the TeX Live installer.
+#
+
+our %vars;
+our $tlpdb;
+our @collections_std;
+our @collections_lang;
+our @collections_lang_doc;
+our $texlive_release;
+our $trynet;
+our $max_bins_on_CD;
+
+my $MENU_CONTINUE = -1;
+our $MENU_INSTALL = 0;
+our $MENU_ABORT = 1;
+our $MENU_QUIT = 2;
+
+
+my $RETURN = $MENU_CONTINUE;
+
+sub clear_screen {
+ return 0 if ($::opt_no_cls);
+ (unix)? system 'clear':system 'cls';
+}
+
+sub string_to_list {
+ my $string=shift;
+ return split(//, $string);
+}
+
+sub button {
+ my $val=shift;
+ return ($val)? '[X]':'[ ]';
+}
+
+sub hbar {
+ return '=' x79, "\n";
+}
+
+sub toggle {
+ my $var=shift;
+ my $val=$vars{$var};
+ ++$val;
+ $vars{$var}=$val%2;;
+}
+
+sub menu_head {
+ my $text=shift;
+ clear_screen;
+ print "$text\n", hbar, "\n";
+}
+
+sub other_options {
+ my @options=@_;
+ my %opts=(
+ '-' => 'deselect all',
+ '+' => 'select all',
+ 'H' => 'help',
+ 'I' => 'start installation',
+ 'N' => 'add binaries from net',
+ 'R' => 'return to main menu',
+ 'Q' => 'quit'
+ );
+
+ print "\nOther options:\n", hbar;
+ for my $option (@options) {
+ if (defined $opts{"$option"}) {
+ printf " <%s> %s\n", $option, $opts{$option};
+ } else {
+ die "other_options: $opts{$option} undefined.\n";
+ }
+ }
+}
+
+sub prompt {
+ my $prompt=shift;
+ print "\n$prompt: ";
+ chomp(my $answer=<STDIN>);
+ return "$answer";
+}
+
+# The menu loop. A menu is a function. Its return value is a
+# reference to another menu or to itself.
+sub run_menu {
+ my $menu=\&main_menu;
+ while ($RETURN == $MENU_CONTINUE) {
+ $menu=$menu->();
+ }
+ return($RETURN);
+}
+
+
+sub binary_menu {
+ my %command=(
+ 'self' => \&binary_menu,
+ 'R' => \&main_menu,
+ 'Q' => \&quit
+ );
+
+ my @diskbins;
+ my @netbins;
+ my %from_net;
+ my @keys=string_to_list "abcdefghijklmopstuvwxyz";
+ my $index=0;
+ my $diskbin='';
+ my %keyval;
+ my $selected_platform;
+
+ menu_head "Available sets of binaries:";
+
+ foreach my $key (keys %vars) {
+ if ($key=~/diskbin_(.*)/) {
+ push @diskbins, $1;
+ $from_net{"$1"}=0;
+ }
+ if ($key=~/netbin_(.*)/) {
+ push @netbins, $1;
+ $from_net{"$1"}=1;
+ }
+ }
+ my @binaries=sort(@diskbins,@netbins);
+
+ set_install_platform;
+
+ $vars{'n_systems_available'}=0;
+ for my $key (keys %vars) {
+ ++$vars{'n_systems_available'} if ($key=~/^(disk|net)bin/);
+ }
+
+ $diskbin=' '
+ if (media eq 'CD' and $vars{'n_systems_available'}>$max_bins_on_CD);
+
+ foreach my $binary (@binaries) {
+ if (media eq 'CD' and $vars{'n_systems_available'}>$max_bins_on_CD) {
+ $diskbin=$from_net{"$binary"}? "* ":" ";
+ }
+ printf " %s %s %s%-16s %s\n", $keys[$index],
+ button($from_net{"$binary"}?
+ $vars{"netbin_$binary"}:$vars{"diskbin_$binary"}),
+ $diskbin, "$binary" . ":",
+ platform_desc "$binary";
+ $keyval{"$keys[$index]"}=$from_net{"$binary"}?
+ "netbin_$binary":"diskbin_$binary";
+ ++$index;
+ }
+ if ($vars{'n_systems_available'}<=$max_bins_on_CD ) {
+ print "\n Binaries for additional systems are available on the DVD.\n" .
+ " If you have network access, try option <N>.\n";
+
+ other_options qw(- + N R Q);
+ } else {
+ print "\n Network access is required to install binary systems " .
+ "marked with '*'.\n" if (media eq 'CD');
+
+ other_options qw(- + R Q);
+ }
+
+ my $answer=prompt 'Press key to select/deselect binary systems';
+
+ my @keystrokes=string_to_list $answer;
+
+ foreach my $keystroke (@keystrokes) {
+ if ($keystroke eq '-') {
+ for my $binary (@binaries) {
+ $vars{"netbin_$binary"}=0 if defined $vars{"netbin_$binary"};
+ $vars{"diskbin_$binary"}=0 if defined $vars{"diskbin_$binary"};
+ }
+ }
+ if ($keystroke eq '+') {
+ for my $binary (@binaries) {
+ $vars{"netbin_$binary"}=1 if defined $vars{"netbin_$binary"};
+ $vars{"diskbin_$binary"}=1 if defined $vars{"diskbin_$binary"};
+ }
+ }
+ if (defined $keyval{$keystroke}) {
+ toggle "$keyval{$keystroke}";
+ }
+ }
+ if ("\u$answer" eq 'N' and media eq 'CD') {
+ $trynet=1;
+ set_platforms_supported;
+ $trynet=0;
+ return $command{'self'};
+ }
+ if (defined $command{"\u$answer"}) {
+ return $command{"\u$answer"}->();
+ } else {
+ return $command{'self'}->();
+ }
+}
+
+
+sub scheme_menu {
+ my %command=(
+ 'self' => \&scheme_menu,
+ 'R' => \&main_menu,
+ 'Q' => \&quit
+ );
+
+ my @schemes;
+ my @keys=string_to_list "abcdefghijklmnopstuvwxyz";
+ my %keyval;
+ my $index=0;
+
+ menu_head 'Select a scheme:';
+
+ foreach my $pkg ($tlpdb->list_packages) {
+ my $tlpobj = $tlpdb->{'tlps'}{$pkg};
+ if ($tlpobj->category eq "Scheme") {
+ push @schemes, $pkg;
+ $vars{"$pkg"}=($vars{'selected_scheme'} eq $pkg)? 1:0;
+ }
+ }
+ @schemes=sort @schemes;
+
+ foreach my $scheme (@schemes) {
+ $keyval{$keys[$index]}="$scheme";
+ my $tlpobj = $tlpdb->get_package("$scheme");
+ printf " %s %s %s\n", $keys[$index], button($vars{"$scheme"}),
+ $tlpobj->shortdesc;
+ ++$index;
+ }
+
+ foreach my $entry (keys %vars) {
+ if ($entry=~/^(collection-.*)/) {
+ $vars{"$1"}=0;
+ }
+ }
+
+ my $scheme_tlpobj = $tlpdb->get_package($vars{'selected_scheme'});
+ if (defined ($scheme_tlpobj)) {
+ foreach my $dependent ($scheme_tlpobj->depends) {
+ if ($dependent=~/^(collection-.*)/) {
+ $vars{"$1"}=1;
+ }
+ }
+ }
+
+ other_options qw(R Q);
+ my $answer=prompt 'Press key to select a scheme';
+
+ if (defined $keyval{"$answer"}) {
+ $vars{'selected_scheme'}=$keyval{"$answer"};
+ return $command{'self'}->();
+ }
+ if (defined $command{"\u$answer"}) {
+ return $command{"\u$answer"}->();
+ } else {
+ return $command{'self'}->();
+ }
+}
+
+
+sub collection_menu {
+ my %command=(
+ 'self' => \&collection_menu,
+ 'R' => \&main_menu,
+ 'Q' => \&quit
+ );
+
+ my @collections;
+ my @keys=string_to_list "abcdefghijklmnopstuvwxyzABCDEFGHIJKLMNOPSTUVWXYZ";
+ my %keyval;
+ my $index=0;
+ my @coll_short_desc;
+ my @coll_long_desc;
+
+ menu_head 'Select collections:';
+
+ @collections=sort @collections_std;
+
+ foreach my $collection (@collections) {
+ next if ($collection eq 'collection-perl');
+ my $tlpobj = $tlpdb->get_package("$collection");
+ if (length $tlpobj->shortdesc>30) {
+ push @coll_long_desc, $collection;
+ } else {
+ push @coll_short_desc, $collection;
+ }
+ }
+ my $singlecolumn_index=@coll_short_desc-1;
+
+##<cols=2>
+ my $lines=@coll_short_desc/2;
+ ++$lines if (@coll_short_desc%2);
+ for (0..$lines-1) {
+ $index=$_;
+ my $collection=$coll_short_desc[$index];
+ my $tlpobj = $tlpdb->get_package("$collection");
+ $keyval{$keys[$index]}="$collection";
+ printf " %s %s %-33s", $keys[$index], button($vars{"$collection"}),
+ substr($tlpobj->shortdesc,0,33);
+ if (defined $coll_short_desc[$index+$lines]) {
+ my $collection=$coll_short_desc[$index+$lines];
+ my $tlpobj=$tlpdb->get_package("$collection");
+ $keyval{$keys[$index+$lines]}="$collection";
+ printf " %s %s %-32s\n", $keys[$index+$lines],
+ button($vars{"$collection"}), substr($tlpobj->shortdesc,0,32);
+ } else {
+ print "\n";
+ }
+ }
+##</cols=2>
+ $index=$singlecolumn_index;
+# print "\n$index\n\n";
+ foreach my $collection (@coll_long_desc) {
+ my $tlpobj=$tlpdb->get_package("$collection");
+ $keyval{$keys[$index+1]}="$collection";
+ printf " %s %s %s\n", $keys[$index+1], button($vars{"$collection"}),
+ $tlpobj->shortdesc;
+ ++$index;
+ }
+##</cols=1>
+
+ other_options qw(- + R Q);
+ my $answer=prompt 'Press key to select collections';
+
+ my @keystrokes=string_to_list $answer;
+
+ foreach my $keystroke (@keystrokes) {
+ if ($keystroke eq '-') {
+ for my $collection (@collections) {
+ $vars{"$collection"}=0 if defined $vars{"$collection"};
+ }
+ }
+ if ($keystroke eq '+') {
+ for my $collection (@collections) {
+ $vars{"$collection"}=1 if defined $vars{"$collection"};
+ }
+ }
+ if (defined $keyval{$keystroke}) {
+ toggle "$keyval{$keystroke}";
+ }
+ }
+
+ if (defined $command{"\u$answer"}) {
+ return $command{"\u$answer"}->();
+ } else {
+ return $command{'self'}->();
+ }
+}
+
+sub language_menu {
+ my %command=(
+ 'self' => \&language_menu,
+ 'R' => \&main_menu,
+ 'Q' => \&quit
+ );
+
+ my @languages;
+ my @lang_docs;
+ my @lang_keys=string_to_list "abcdefghijklmnopstuvwxyz0123456789";
+ my @lang_doc_keys=string_to_list "ABCDEFGHIJKLMNOPSTUVWXYZ";
+ my %keyval;
+ my $lang_index=0;
+ my $lang_doc_index=0;
+ my $lines;
+
+ menu_head 'Select languages:';
+
+ @languages=sort @collections_lang;
+ @lang_docs=sort @collections_lang_doc;
+
+ $lines=@languages/2;
+ ++$lines if (@languages%2);
+ for my $index (0..$lines-1) {
+ my $language=$languages[$index];
+ my $tlpobj = $tlpdb->get_package("$language");
+ $keyval{$lang_keys[$index]}="$language";
+ printf " %s %s %-33s", $lang_keys[$index], button($vars{"$language"}),
+ substr($tlpobj->shortdesc,0,33);
+ if (defined $languages[$index+$lines]) {
+ my $language=$languages[$index+$lines];
+ my $tlpobj = $tlpdb->get_package("$language");
+ $keyval{$lang_keys[$index+$lines]}="$language";
+ printf " %s %s %-32s\n", $lang_keys[$index+$lines],
+ button($vars{"$language"}), substr($tlpobj->shortdesc,0,32);
+ } else {
+ print "\n";
+ }
+ }
+
+ print "\nLanguage specific documentation. Select languages first.\n\n";
+
+ $lines=@lang_docs/2;
+ ++$lines if (@lang_docs%2);
+ for my $index (0..$lines-1) {
+ my $lang_doc=$lang_docs[$index];
+ my $tlpobj = $tlpdb->get_package("$lang_doc");
+ $keyval{$lang_doc_keys[$index]}="$lang_doc";
+ printf " %s %s %-33s", $lang_doc_keys[$index], button($vars{"$lang_doc"}),
+ substr($tlpobj->shortdesc,0,33);
+ if (defined $lang_docs[$index+$lines]) {
+ my $lang_doc=$lang_docs[$index+$lines];
+ my $tlpobj = $tlpdb->get_package("$lang_doc");
+ $keyval{$lang_doc_keys[$index+$lines]}="$lang_doc";
+ printf " %s %s %-32s\n", $lang_doc_keys[$index+$lines],
+ button($vars{"$lang_doc"}), substr($tlpobj->shortdesc,0,32);
+ } else {
+ print "\n";
+ }
+ }
+
+ other_options qw (+ - R Q);
+ my $answer=prompt 'Press key to select language';
+
+ my @keystrokes=string_to_list $answer;
+
+ foreach my $keystroke (@keystrokes) {
+ if ($keystroke eq '-') {
+ for my $collection (@languages,@lang_docs) {
+ $vars{"$collection"}=0 if defined $vars{"$collection"};
+ }
+ }
+ if ($keystroke eq '+') {
+ for my $collection (@languages,@lang_docs) {
+ $vars{"$collection"}=1 if defined $vars{"$collection"};
+ }
+ }
+ if (defined $keyval{$keystroke}) {
+ toggle "$keyval{$keystroke}";
+ }
+ }
+
+ if (defined $keyval{"$answer"}) {
+ $vars{'selected_scheme'}=$keyval{"$answer"};
+ return $command{'self'}->();
+ }
+ if (defined $command{"\u$answer"}) {
+ return $command{"\u$answer"}->();
+ } else {
+ return $command{'self'}->();
+ }
+}
+
+
+sub directories_menu {
+ my %command=(
+ 'self' => \&directories_menu,
+ 'R' => \&main_menu,
+ 'Q' => \&quit
+ );
+
+ menu_head "Current directories setup:";
+ print <<"EOF";
+ <1> TEXDIR: $vars{'TEXDIR'}
+ support tree: $vars{'TEXDIR'}/texmf
+
+ <2> TEXMFLOCAL: $vars{'TEXMFLOCAL'}
+ <3> TEXMFSYSVAR: $vars{'TEXMFSYSVAR'}
+
+ <4> TEXMFHOME: $vars{'TEXMFHOME'}
+ (~ will be expanded to \$HOME/\$USERPROFILE)
+EOF
+;
+
+ other_options qw (R Q);
+ my $answer=prompt 'Enter command';
+
+ if ("\u$answer" eq '1') {
+ print "New value TEXDIR [$vars{'TEXDIR'}]: ";
+ chomp($answer=<STDIN>);
+ $vars{'TEXDIR'}="$answer" if (length $answer);
+ $vars{'TEXDIR'}=~s@\\@/@g if (win32);
+ if ($vars{'TEXDIR'}=~/^(.*)\/$texlive_release$/) {
+ $vars{'TEXMFLOCAL'}="$1/texmf-local";
+ $vars{'TEXMFSYSVAR'}="$1/$texlive_release/texmf-var";
+ return $command{'self'};
+ } elsif ($vars{'TEXDIR'}=~/^(.*)$/) {
+ $vars{'TEXMFLOCAL'}="$1/texmf-local";
+ $vars{'TEXMFSYSVAR'}="$1/texmf-var";
+ return $command{'self'};
+ }
+ }
+ if ("\u$answer" eq '2') {
+ print "New value TEXMFLOCAL [$vars{'TEXMFLOCAL'}]: ";
+ chomp($answer=<STDIN>);
+ $vars{'TEXMFLOCAL'}="$answer" if (length $answer);
+ $vars{'TEXMFLOCAL'}=~s@\\@/@g if (win32);
+ return $command{'self'};
+ }
+ if ("\u$answer" eq '3') {
+ print "New value TEXMFSYSVAR [$vars{'TEXMFSYSVAR'}]: ";
+ chomp($answer=<STDIN>);
+ $vars{'TEXMFSYSVAR'}="$answer" if (length $answer);
+ $vars{'TEXMFSYSVAR'}=~s@\\@/@g if (win32);
+ return $command{'self'};
+ }
+ if ("\u$answer" eq '4') {
+ print "New value TEXMFHOME [$vars{'TEXMFHOME'}]: ";
+ chomp($answer=<STDIN>);
+ $vars{'TEXMFHOME'}="$answer" if (length $answer);
+ $vars{'TEXMFHOME'}=~s@\\@/@g if (win32);
+ return $command{'self'};
+ }
+
+ if (defined $command{"\u$answer"}) {
+ return $command{"\u$answer"}->();
+ } else {
+ return $command{'self'}->();
+ }
+}
+
+$vars{'page'}=0;
+
+sub html2text {
+ my $filename=shift;
+ my @text;
+ open IN, "$filename";
+ @all_lines=<IN>;
+ close IN;
+ chomp @all_lines;
+
+ my $itemcnt;
+ my $ordered_list=0;
+ my $h1_indent=25;
+ my $h2_indent=3;
+ my $h3_indent=6;
+
+ for (@all_lines) {
+ next if /DOCTYPE/;
+ next if /<!--/;
+ next if /<title/i;
+ next if /<\/?body/i;
+ next if /<\/?html/i;
+ next if /<\/?head/i;
+ next if /<\/?meta/i;
+ next if /^\s*$/; # ignore empty lines
+
+ s/<i>/"/gi; s/<\/i>/"/gi; # italics
+ s/<tt>/'/gi; s/<\/tt>/'/gi; # typewriter
+ s/<p>.*//gi; # paragraphs
+ s/<\/ul>.*//gi; # unsorted lists
+ s/<\/ol>.*//gi; # ordered lists
+ s/&emdash;/--/gi; # emdash
+ s/&lt;/</gi; s/&gt;/>/gi; # < and >
+ if (/<h1>(.*?)<\/h1>/i) {
+ push @text, " " x $h1_indent. "$1\n";
+ push @text, " " x $h1_indent. "=" x (length $1). "\n";
+ push @text, "\n";
+ } elsif (/<h2>(.*?)<\/h2>/i) {
+ push @text, "\n";
+ push @text, " " x $h2_indent. "$1\n";
+ push @text, " " x $h2_indent. "~" x (length $1). "\n";
+ push @text, "\n";
+ } elsif (/<h3>(.*?)<\/h3>/i) {
+ push @text, "\n";
+ push @text, " " x $h3_indent. "$1\n";
+ push @text, " " x $h3_indent. "-" x (length $1). "\n";
+ push @text, "\n";
+ } elsif (/<ol>/i) {
+ $ordered_list=1;
+ $itemcnt=1;
+ } elsif (/<ul>/i) {
+ $ordered_list=0;
+ } elsif (/^\s*<li>\s*(.*)/) {
+ if ($ordered_list) {
+ push @text, "\n";
+ push @text, " $itemcnt. $1\n";
+ ++$itemcnt;
+ } else {
+ push @text, "\n";
+ push @text, " * $1\n";
+ }
+ } else {
+ push @text, "$_\n";
+ }
+ }
+ return @text;
+}
+
+
+sub help_menu {
+ my %command=(
+ 'self' => \&help_menu,
+ 'R' => \&main_menu,
+ 'Q' => \&quit
+ );
+ my $installer_help="$installerdir/install-tl.html";
+
+ clear_screen;
+
+ my @text=html2text "$installer_help";
+ my $lines=(@text);
+ my $overlap=3;
+ my $lps=32; # lines per screen - overlap
+ my $firstline=$vars{'page'}*$lps;
+ my $lastline=$firstline+$lps+$overlap;
+ my $line=0;
+# print "<<<$firstline>>> <<<$lastline>>>\n";
+ for (@text) {
+ print "$_" if ($line>=$firstline and $line<=$lastline);
+ ++$line;
+ }
+ print "\n", hbar,
+ " <T> top <N> next page <P> previous page <R> return"
+ . " --", $vars{'page'}+1, "--\n";
+
+ my $answer=prompt 'Enter command';
+
+ if ("\u$answer" eq 'T') {
+ $vars{'page'}=0;
+ return $command{'self'};
+ }
+ if ("\u$answer" eq 'N') {
+ $vars{'page'}+=1 unless $lastline>$lines;
+ return $command{'self'};
+ }
+ if ("\u$answer" eq 'P') {
+ $vars{'page'}-=1 if $vars{'page'}>=1;
+ return $command{'self'};
+ }
+ if (defined $command{"\u$answer"}) {
+ return $command{"\u$answer"};
+ } else {
+ return $command{'self'};
+ }
+}
+
+
+sub options_menu {
+ my $b_symlinks=button($vars{'option_symlinks'});
+ my $b_doc=button($vars{'option_doc'});
+ my $b_src=button($vars{'option_src'});
+ my $b_fmt=button($vars{'option_fmt'});
+ my $b_letter=button($vars{'option_letter'});
+
+ my $sys_bin=$vars{'sys_bin'};
+ my $sys_man=$vars{'sys_man'};
+ my $sys_info=$vars{'sys_info'};
+
+ my $t_sys_bin=($vars{'option_symlinks'})? $vars{'sys_bin'}:'';
+ my $t_sys_man=($vars{'option_symlinks'})? $vars{'sys_man'}:'';
+ my $t_sys_info=($vars{'option_symlinks'})? $vars{'sys_info'}:'';
+
+ my %command=(
+ 'self' => \&options_menu,
+ 'R' => \&main_menu,
+ 'Q' => \&quit
+ );
+
+ clear_screen;
+ menu_head "Current options setup:";
+
+ print <<"EOF";
+ <P> use letter size instead of A4 by default: $b_letter
+ <F> create all format files: $b_fmt
+ <D> install font/macro doc tree: $b_doc
+ <S> install font/macro source tree: $b_src
+EOF
+;
+ if (unix) {
+ print <<"EOF";
+ <L> create symlinks in standard directories: $b_symlinks
+ binaries to: $t_sys_bin
+ manpages to: $t_sys_man
+ info to: $t_sys_info
+EOF
+;
+ }
+ other_options qw(R Q);
+ my $answer=prompt 'Enter command';
+
+ if (unix) {
+ if ("\u$answer" eq 'L') {
+ toggle 'option_symlinks';
+ if ($vars{'option_symlinks'}) {
+ print "New value for binary directory [$sys_bin]: ";
+ chomp($answer=<STDIN>);
+ $vars{'sys_bin'}="$answer" if (length $answer);
+
+ if ($vars{'sys_bin'}=~/^(.*)\/bin$/) {
+ $vars{'sys_man'}="$1/man";
+ $vars{'sys_info'}="$1/info";
+ }
+ print "New value for man directory [$vars{'sys_man'}]: ";
+ chomp($answer=<STDIN>);
+ $vars{'sys_man'}="$answer" if (length $answer);
+
+ print "New value for info directory [$vars{'sys_info'}]: ";
+ chomp($answer=<STDIN>);
+ $vars{'sys_info'}="$answer" if (length $answer);
+ }
+ return $command{'self'};
+ }
+ }
+ if ("\u$answer" eq 'P') {
+ toggle 'option_letter';
+ return $command{'self'};
+ }
+ if ("\u$answer" eq 'F') {
+ toggle 'option_fmt';
+ return $command{'self'};
+ }
+ if ("\u$answer" eq 'S') {
+ toggle 'option_src';
+ return $command{'self'};
+ }
+ if ("\u$answer" eq 'S') {
+ toggle 'option_src';
+ return $command{'self'};
+ }
+ if ("\u$answer" eq 'D') {
+ toggle 'option_doc';
+ return $command{'self'};
+ }
+ if (defined $command{"\u$answer"}) {
+ return $command{"\u$answer"};
+ } else {
+ return $command{'self'};
+ }
+}
+
+
+sub quit {
+ exit 0;
+ $RETURN = $MENU_QUIT;
+}
+
+sub do_install {
+ $RETURN = $MENU_INSTALL;
+}
+
+sub main_menu {
+ my $this_platform=platform_desc($vars{'this_platform'});
+
+ my $b_symlinks=button($vars{'option_symlinks'});
+ my $b_doc=button($vars{'option_doc'});
+ my $b_src=button($vars{'option_src'});
+ my $b_fmt=button($vars{'option_fmt'});
+ my $b_letter=button($vars{'option_letter'});
+
+ my $warn_nobin;
+
+ $vars{'n_systems_available'}=0;
+ for my $key (keys %vars) {
+ ++$vars{'n_systems_available'} if ($key=~/^(disk|net)bin/);
+ }
+
+ $warn_nobin=set_install_platform;
+
+ $vars{'n_systems_selected'}=0;
+ $vars{'n_collections_selected'}=0;
+ foreach my $key (keys %vars) {
+ if ($key=~/^diskbin.*/ or $key=~/^netbin.*/) {
+ ++$vars{'n_systems_selected'} if $vars{$key}==1;
+ }
+ if ($key=~/^collection/) {
+ ++$vars{'n_collections_selected'} if $vars{$key}==1;
+ }
+ }
+ calc_depends;
+
+ my %command=(
+ 'self' => \&main_menu,
+ 'P' => \&platform_menu,
+ 'O' => \&options_menu,
+ 'I' => \&do_install,
+ 'C' => \&collection_menu,
+ 'H' => \&help_menu,
+ 'L' => \&language_menu,
+ 'D' => \&directories_menu,
+ 'S' => \&scheme_menu,
+ 'B' => \&binary_menu,
+ 'Q' => \&quit
+ );
+
+ clear_screen;
+
+ print <<"EOF";
+======================> TeX Live installation procedure <=====================
+
+=======> Note: Letters/digits in <angle brackets> indicate menu items <=======
+=======> for commands or configurable options <=======
+
+ Proposed platform: $this_platform
+ $warn_nobin
+ <B> binary systems: $vars{'n_systems_selected'} out of $vars{'n_systems_available'}
+
+ <S> Installation scheme ($vars{'selected_scheme'})
+
+ Customizing installation scheme:
+ <C> standard collections
+ <L> language collections
+ $vars{'n_collections_selected'} collections out of $vars{'n_collections_available'}, disk space required: $vars{'total_size'} MB
+
+ <D> directories:
+ TEXDIR (The main TeX directory) : $vars{'TEXDIR'}
+ TEXMFLOCAL (Directory for local styles etc): $vars{'TEXMFLOCAL'}
+ TEXMFSYSVAR (Directory for local config) : $vars{'TEXMFSYSVAR'}
+
+ <O> options:
+EOF
+;
+print <<"EOF";
+ $b_letter use letter size instead of A4 by default
+ $b_fmt create all format files
+ $b_doc install macro/font doc tree
+ $b_src install macro/font source tree
+EOF
+;
+ print <<"EOF" if (unix);
+ $b_symlinks create symlinks in standard directories
+EOF
+;
+
+ other_options qw (I H Q);
+ my $answer=prompt 'Enter command';
+
+ if (defined $command{"\u$answer"}) {
+ return $command{"\u$answer"};
+ } else {
+ return $command{'self'};
+ }
+}
+
+# needs a terminal 1 for require to succeed!
+1;
+
+__END__
+
+### Local Variables:
+### perl-indent-level: 2
+### tab-width: 2
+### indent-tabs-mode: nil
+### End:
+# vim:set tabstop=2 expandtab: #
diff --git a/Master/tlpkg/installer/texlive2008.png b/Master/tlpkg/installer/texlive2008.png
new file mode 100644
index 00000000000..948889d933b
--- /dev/null
+++ b/Master/tlpkg/installer/texlive2008.png
Binary files differ