summaryrefslogtreecommitdiff
path: root/systems/texlive/tlnet/tlpkg/installer/install-menu-text.pl
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-04-04 03:14:42 +0000
committerNorbert Preining <norbert@preining.info>2022-04-04 03:14:42 +0000
commit7548e4d37c2aaefd32fe0a9bcd83f8e71326dde1 (patch)
treed335b608e63e9b3c37d7ba0e567c63e77250e171 /systems/texlive/tlnet/tlpkg/installer/install-menu-text.pl
parent506de1e2d3515161cdbc7018b4ccc9e49d7f86e8 (diff)
CTAN sync 202204040314
Diffstat (limited to 'systems/texlive/tlnet/tlpkg/installer/install-menu-text.pl')
-rw-r--r--systems/texlive/tlnet/tlpkg/installer/install-menu-text.pl50
1 files changed, 42 insertions, 8 deletions
diff --git a/systems/texlive/tlnet/tlpkg/installer/install-menu-text.pl b/systems/texlive/tlnet/tlpkg/installer/install-menu-text.pl
index a7409f146e..bcf7003b00 100644
--- a/systems/texlive/tlnet/tlpkg/installer/install-menu-text.pl
+++ b/systems/texlive/tlnet/tlpkg/installer/install-menu-text.pl
@@ -1,15 +1,15 @@
#!/usr/bin/env perl
-# $Id: install-menu-text.pl 57970 2021-02-27 14:17:34Z siepo $
-# install-menu-txt.pl
+# $Id: install-menu-text.pl 62571 2022-03-09 22:53:42Z karl $
#
-# Copyright 2007-2021 Norbert Preining, Karl Berry
+# Copyright 2007-2022 Norbert Preining, Karl Berry
# Copyright 2007-2008 Reinhard Kotucha
# 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.
-use vars qw(@::end_install_hook $::opt_no_cls);
+use vars qw(@::end_install_hook
+ $::opt_no_cls $::opt_select_repository $::run_menu);
our %vars;
our $opt_in_place;
@@ -239,7 +239,7 @@ sub run_menu_text {
warn "\n";
warn "Please select a different mirror! See info above.\n";
print STDERR "Press Enter to exit... ";
- $ans = readline (*STDIN);
+ my $ans = readline (*STDIN);
exit (1);
}
@@ -545,6 +545,10 @@ EOF
if ("\u$answer" eq '1' and !$opt_in_place) {
print "New value for TEXDIR [$vars{'TEXDIR'}]: ";
$answer = &input_dirname ();
+ # update free space information
+ if ($answer ne $vars{'TEXDIR'}) {
+ $vars{'free_size'} = TeXLive::TLUtils::diskfree($answer);
+ }
$vars{'TEXDIR'} = $answer if $answer ne "";
my $texdirnoslash;
if ($vars{'TEXDIR'}=~/^(.*)\/$texlive_release$/) {
@@ -715,7 +719,7 @@ sub help_menu {
'R' => \&main_menu,
'Q' => \&quit
);
- my $installer_help="$installerdir/tlpkg/installer/install-tl.html";
+ my $installer_help = "notused/tlpkg/installer/install-tl.html";
clear_screen;
@@ -958,7 +962,36 @@ sub quit {
}
sub do_install {
- $RETURN = $MENU_INSTALL;
+ my $reserve = 100;
+ my $doit = 1;
+ if ($vars{'free_size'} > 0
+ && $vars{'free_size'} + $reserve < $vars{'total_size'}) {
+ print STDERR <<"EOF";
+*** WARNING ****************************************************
+The installation requires $vars{'total_size'}M of disk space
+but only $vars{'free_size'}M is available.
+
+You probably want to either clean up the destination filesystem,
+or choose a different installation location,
+or reduce what gets installed.
+
+Press Enter to return to the menu, or i to install anyway.
+****************************************************************
+EOF
+ my $ans = readline (*STDIN);
+ $doit = 0;
+ chomp($ans);
+ if ($ans eq "i" or $ans eq "I") {
+ $doit = 1;
+ }
+ }
+ if ($doit) {
+ # set env variable to make install-tl not trip over
+ $ENV{'TEXLIVE_INSTALL_NO_DISKCHECK'} = 1;
+ $RETURN = $MENU_INSTALL;
+ } else {
+ main_menu();
+ }
}
sub toggle_portable {
@@ -1035,6 +1068,7 @@ sub main_menu {
}
clear_screen;
+ my $freestring = ($vars{'free_size'} >= 0 ? " (free: $vars{'free_size'} MB)" : "");
print <<"EOF";
======================> TeX Live installation procedure <=====================
@@ -1053,7 +1087,7 @@ EOF
<S> set installation scheme: $vars{'selected_scheme'}
<C> set installation collections:
- $vars{'n_collections_selected'} collections out of $vars{'n_collections_available'}, disk space required: $vars{'total_size'} MB
+ $vars{'n_collections_selected'} collections out of $vars{'n_collections_available'}, disk space required: $vars{'total_size'} MB$freestring
EOF
}