diff options
-rwxr-xr-x | Master/install-tl | 6 | ||||
-rw-r--r-- | Master/tlpkg/TeXLive/TLUtils.pm | 21 |
2 files changed, 16 insertions, 11 deletions
diff --git a/Master/install-tl b/Master/install-tl index f649b91b858..9921aa57ba1 100755 --- a/Master/install-tl +++ b/Master/install-tl @@ -1047,7 +1047,9 @@ sub do_installation { tlwarn("$0: Insufficient disk space\n$msg\n" ." but continuing anyway per envvar TEXLIVE_INSTALL_NO_DISKCHECK\n"); } else { - tldie("$0: DISK SPACE INSUFFICIENT!\n$msg\nAborting installation.\n"); + tldie("$0: DISK SPACE INSUFFICIENT!\n$msg\nAborting installation.\n" + . " To skip the check, set the environment variable\n" + . " TEXLIVE_INSTALL_NO_DISKCHECK=1\n"); } } } @@ -3470,7 +3472,7 @@ Omit creating the ConTeXt cache. This is useful for redistributors. =item C<TEXLIVE_INSTALL_NO_DISKCHECK> If set to 1, omit free disk space check. By default, if a -POSIX-compliant C<df> program (supporting C<-P>) is available, the +POSIX-compliant C<df> program (supporting C<-Pk>) is available, the installer checks for available disk space in the selected installation location, and will abort installation if there is insufficient disk space, plus a margin of 100MB. An equivalent check is made on Windows diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm index ab0d5ddc9c5..a03ca61ced6 100644 --- a/Master/tlpkg/TeXLive/TLUtils.pm +++ b/Master/tlpkg/TeXLive/TLUtils.pm @@ -879,20 +879,23 @@ sub diskfree { $td .= "/" if ($td !~ m!/$!); return (-1) if (! -e $td); debug("checking diskfree() in $td\n"); - ($output, $retval) = run_cmd("df -P \"$td\"", POSIXLY_CORRECT => 1); + ($output, $retval) = run_cmd("df -Pk \"$td\""); + # With -k (mandated by POSIX), we should always get 1024-blocks. + # Otherwise, the POSIXLY_CORRECT envvar for GNU df would need to + # be set, to force 512-blocks; and the BLOCKSIZE envvar would need + # to be unset to avoid overriding. if ($retval == 0) { # Output format should be this: - # Filesystem 512-blocks Used Available Capacity Mounted on - # /dev/sdb3 6099908248 3590818104 2406881416 60% /home + # Filesystem 1024-blocks Used Available Capacity Mounted on + # /dev/sdb3 209611780 67718736 141893044 33% / my ($h,$l) = split(/\n/, $output); my ($fs, $nrb, $used, $avail, @rest) = split(' ', $l); - debug("diskfree: df -P output: $output"); - debug("diskfree: used=$used (512-block), avail=$avail (512-block)\n"); - # $avail is in 512-byte blocks, so we need to divide by 2*1024 to - # obtain Mb. Require that at least 100M remain free. - return (int($avail / 2048)); + debug("diskfree: df -Pk output: $output"); + debug("diskfree: used=$used (1024-block), avail=$avail (1024-block)\n"); + # $avail is in 1024-byte blocks, so we divide by 1024 to obtain Mb. + return (int($avail / 1024)); } else { - # error in running df -P for whatever reason + # error in running df -P for whatever reason, just skip the check. return (-1); } } |