diff options
Diffstat (limited to 'systems/texlive/tlnet/install-tl')
-rwxr-xr-x | systems/texlive/tlnet/install-tl | 80 |
1 files changed, 66 insertions, 14 deletions
diff --git a/systems/texlive/tlnet/install-tl b/systems/texlive/tlnet/install-tl index dc9f2b5809..e1e1bb11a8 100755 --- a/systems/texlive/tlnet/install-tl +++ b/systems/texlive/tlnet/install-tl @@ -1,5 +1,5 @@ #!/usr/bin/env perl -# $Id: install-tl 62146 2022-02-22 22:48:10Z karl $ +# $Id: install-tl 62745 2022-03-16 22:20:47Z karl $ # Copyright 2007-2022 # Reinhard Kotucha, Norbert Preining, Karl Berry, Siep Kroonenberg. # This file is licensed under the GNU General Public License version 2 @@ -10,7 +10,7 @@ use strict; use warnings; -my $svnrev = '$Revision: 62146 $'; +my $svnrev = '$Revision: 62745 $'; $svnrev =~ m/: ([0-9]+) /; $::installerrevision = ($1 ? $1 : 'unknown'); @@ -107,11 +107,12 @@ if (($^O !~ /^MSWin/i) && $asked4tcl = 1; $i++; } else { - die "$0: illegal value $q for parameter -gui.\n"; + die "$0: invalid value for parameter -gui: $q\n"; } } } else { - for my $q (qw/in-place profile help print-arch print-platform version no-gui/) { + for my $q (qw/in-place profile help print-arch print-platform + version no-gui/) { if ($p eq "-$q") { # ignore gui mode $want_tcl = 0; @@ -298,8 +299,7 @@ my $opt_scheme = ""; my $opt_version = 0; my $opt_warn_checksums = 1; my $opt_font; -# we might want to set this to 1 ...? TODO -my $opt_continue = 0; +my $opt_continue = 1; # unusual cases: $::opt_select_repository = 0; our $opt_in_place = 0; @@ -324,6 +324,12 @@ $::debug_translation = 0; # List of packages that failed to install but we continued due to --continue @::installation_failed_packages = (); +# +# set up signal handlers to catch SIGINT and SIGTERM +$SIG{'INT'} = \&signal_handler; +# not necessary AFA we know +# $SIG{TERM} = &signal_handler; + # before we try to interact with the user, we need to know whether or not # install-tl was called from an external gui. This gui will start install-tl # with "-from_ext_gui" as its first command-line option. @@ -368,7 +374,7 @@ process_logging_options(); # now the others GetOptions( "all-options" => \$::opt_all_options, - "continue" => \$opt_continue, + "continue!" => \$opt_continue, "custom-bin=s" => \$opt_custom_bin, "debug-translation" => \$::debug_translation, "debug-fakenet" => \$opt_debug_fakenet, @@ -901,6 +907,8 @@ sub final_remote_init { set_texlive_default_dirs(); set_install_platform(); initialize_collections(); + # size information + $vars{'free_size'} = TeXLive::TLUtils::diskfree($vars{'TEXDIR'}); # initialize the scheme from the command line value, if given. if ($opt_scheme) { @@ -937,6 +945,19 @@ sub do_installation { if (win32()) { TeXLive::TLWinGoo::maybe_make_ro ($vars{'TEXDIR'}); } + # check for free disk space + my $diskfree = TeXLive::TLUtils::diskfree($vars{'TEXDIR'}); + # -1 is returned if df not available or some other error + if ($diskfree != -1) { + my $reserve = 100; + if ( $diskfree + $reserve < $vars{'total_size'}) { + if ($ENV{'TEXLIVE_INSTALL_NO_DISKCHECK'}) { + tlwarn("Insufficient disk space, but continuing anyway."); + } else { + die("DISK SPACE INSUFFICIENT!"); + } + } + } # now remove final slash from TEXDIR even if it is the root of a drive $vars{'TEXDIR'} =~ s!/$!!; # do the actual installation @@ -2423,6 +2444,8 @@ sub import_settings_from_old_tlpdb { tlwarn(" to redo this setting by running:\n"); } } + # update size information + $vars{'free_size'} = TeXLive::TLUtils::diskfree($vars{'TEXDIR'}); } # import_settings_from_old_tlpdb # do everything to select a scheme @@ -2499,6 +2522,14 @@ sub update_numbers { } } # update_numbers +# signal handler for interrupts SIGINT AND SIGTERM +sub signal_handler { + my ($sig) = @_; + flushlog(); + print STDERR "$0: caught SIG$sig -- exiting\n"; + exit(1); +} + # to be called at exit when the installation did not complete sub flushlog { if (!defined($::LOGFILENAME)) { @@ -2691,7 +2722,6 @@ initial installation is complete. The default is C<scheme-full>, which installs everything, and this is highly recommended. - =head1 REFERENCES Post-installation configuration, package updates, and more, are @@ -2704,7 +2734,6 @@ Internet at L<https://tug.org/texlive/doc/install-tl.html>. For the full documentation of TeX Live, see L<https://tug.org/texlive/doc>. - =head1 OPTIONS As usual, all options can be specified in any order, and with either a @@ -2866,14 +2895,27 @@ release. =item B<-no-cls> For the text mode installer only: do not clear the screen when entering -a new menu (for debugging purposes). +a new menu. For debugging. + +=item B<-no-continue> + +Quit early on installation failure of a non-core package. + +By default, a few core packages are installed first; then, a failed +installation of any other (non-core) package is noted, but does not stop +the installation. Any such failed packages are retried, once. + +If the retry also fails, by default the installer proceeds to completion +anyway, with the idea that it was a transient network problem and +reinstallation will succeed later. If this option is specified, and the +retry fails, the installer aborts. =item B<-no-persistent-downloads> =item B<-persistent-downloads> For network installs, activating this option makes the installer try to -set up a persistent connection using the C<Net::LWP> Perl module. This +set up a persistent connection using the C<LWP> Perl module. This opens only one connection between your computer and the server per session and reuses it, instead of initiating a new download for each package, which typically yields a significant speed-up. @@ -2937,7 +2979,6 @@ versions of the TeX Live modules used are also reported. =back - =head1 PROFILES A I<profile> file contains all the values needed to perform an @@ -3074,6 +3115,14 @@ written, the names above are always used. For more details on all of the above options, consult the TeX Live installation manual, linked from L<https://tug.org/texlive/doc>. +=head1 SPACE CONSTRAINTS + +If a POSIX-compliant C<df> program (supporting C<-P>) is available, the +installer will check the available disk space in the selected +installation location, and will abort installation if there is +insufficient disk space, plus a margin of 100MB. In case this check is +invalid for your filesystem, setting the environment variable +C<TEXLIVE_INSTALL_NO_DISKCHECK> to 1 will disable it. =head1 ENVIRONMENT VARIABLES @@ -3103,6 +3152,10 @@ variables. Omit creating the ConTeXt cache. This is useful for redistributors. +=item C<TEXLIVE_INSTALL_NO_DISKCHECK> + +Omit free disk space check. + =item C<TEXLIVE_INSTALL_NO_RESUME> Omit check for installing on top of a previous installation and then @@ -3146,14 +3199,13 @@ Don't try to run the C<--help> message through C<perldoc>. =back - =head1 AUTHORS AND COPYRIGHT This script and its documentation were written for the TeX Live distribution (L<https://tug.org/texlive>) and both are licensed under the GNU General Public License Version 2 or later. -$Id: install-tl 62146 2022-02-22 22:48:10Z karl $ +$Id: install-tl 62745 2022-03-16 22:20:47Z karl $ =cut # to remake HTML version: pod2html --cachedir=/tmp install-tl >/tmp/itl.html |