From 9046560819af791bd48e658db748373db368291c Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 19 Apr 2017 22:27:13 +0000 Subject: exec,sync,doc git-svn-id: svn://tug.org/texlive/trunk@43927 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/tests/TeXLive/TLConfig.pm | 8 ++-- Build/source/texk/tests/TeXLive/TLUtils.pm | 72 ++++++++++++++++++++--------- 2 files changed, 54 insertions(+), 26 deletions(-) (limited to 'Build/source/texk/tests') diff --git a/Build/source/texk/tests/TeXLive/TLConfig.pm b/Build/source/texk/tests/TeXLive/TLConfig.pm index 5e4deea47af..a2941b7d291 100644 --- a/Build/source/texk/tests/TeXLive/TLConfig.pm +++ b/Build/source/texk/tests/TeXLive/TLConfig.pm @@ -5,7 +5,7 @@ package TeXLive::TLConfig; -my $svnrev = '$Revision: 43775 $'; +my $svnrev = '$Revision: 43872 $'; my $_modulerevision = ($svnrev =~ m/: ([0-9]+) /) ? $1 : "unknown"; sub module_revision { return $_modulerevision; } @@ -208,14 +208,14 @@ our $F_NOPOSTACTION = 4; # The length of a checksum generated by tlchecksum and contained in # texlive.tlpdb.checksum. Needs to be in agreement with the hash # method used in TLCrypto::tlchecksum and TLCrypto::tldigest -$ChecksumLength = 128; +our $ChecksumLength = 128; # The program generating the checksum for the file given as first # argument -$ChecksumProgram = "sha512sum"; +our $ChecksumProgram = "sha512sum"; # The extension of the checksum file -$ChecksumExtension = "sha512"; +our $ChecksumExtension = "sha512"; 1; diff --git a/Build/source/texk/tests/TeXLive/TLUtils.pm b/Build/source/texk/tests/TeXLive/TLUtils.pm index 36d440344be..7051bd9f7fd 100644 --- a/Build/source/texk/tests/TeXLive/TLUtils.pm +++ b/Build/source/texk/tests/TeXLive/TLUtils.pm @@ -5,7 +5,7 @@ package TeXLive::TLUtils; -my $svnrev = '$Revision: 43793 $'; +my $svnrev = '$Revision: 43903 $'; my $_modulerevision = ($svnrev =~ m/: ([0-9]+) /) ? $1 : "unknown"; sub module_revision { return $_modulerevision; } @@ -106,12 +106,11 @@ C -- utilities used in TeX Live infrastructure our $PERL_SINGLE_QUOTE; # we steal code from Text::ParseWords use vars qw( $::LOGFILENAME @::LOGLINES - @::debug_hook @::ddebug_hook @::dddebug_hook @::info_hook @::warn_hook - @::install_packages_hook - $::machinereadable - $::no_execute_actions - $::regenerate_all_formats + @::debug_hook @::ddebug_hook @::dddebug_hook @::info_hook + @::install_packages_hook @::warn_hook $TeXLive::TLDownload::net_lib_avail + $::checksum_method $::gui_mode $::machinereadable $::no_execute_actions + $::regenerate_all_formats ); BEGIN { @@ -286,17 +285,45 @@ sub platform_name { } if ($OS eq "darwin") { - # We want to guess x86_64-darwin on new-enough systems. - # Most robust approach is to check sw_vers (os version) - # and sysctl (processor hardware). - chomp (my $sw_vers = `sw_vers -productVersion`); - my ($os_major,$os_minor) = split (/\./, $sw_vers); + # We have a variety of Mac binary sets. + # 10.10/Yosemite and newer: + # -> x86_64-darwin [MacTeX] + # 10.6/Snow Leopard through 10.9/Mavericks: + # -> x86_64-darwinlegacy if 64-bit + # -> i386-darwin otherwise + # 10.5/Leopard: + # -> i386-darwin if x86 + # -> powerpc-darwin if ppc + # + # (BTW, uname -r numbers are larger by 4 than the minor version. + # We don't use uname numbers here.) # - chomp (my $sysctl = `PATH=/usr/sbin:\$PATH sysctl hw.cpu64bit_capable`); - my (undef,$hw_64_bit) = split (" ", $sysctl); + my $mactex_darwin = 10; # the minor 10; this will change in the future. # - $CPU = ($os_major >= 10 && $os_minor >= 6 && $hw_64_bit >= 1) - ? "x86_64" : "universal"; + # Most robust approach is apparently to check sw_vers (os version, + # returns "10.x" values), and sysctl (processor hardware). + chomp (my $sw_vers = `sw_vers -productVersion`); + my ($os_major,$os_minor) = split (/\./, $sw_vers); + if ($os_major != 10) { + warn "$0: only MacOSX is supported, not $OS $os_major.$os_minor " + . " (from sw_vers -productVersion: $sw_vers)\n"; + return "unknown-unknown"; + } + if ($os_minor >= $mactex_darwin) { + ; # current version, default is ok (x86_64-darwin). + } elsif ($os_minor >= 6 && $os_minor < $mactex_darwin) { + # in between, x86 hardware only. On 10.6 only, must check if 64-bit, + # since if later than that, always 64-bit. + my $is64 = $os_minor == 6 + ? `/usr/sbin/sysctl -n hw.cpu64bit_capable` >= 1 + : 1; + if ($is64) { + $CPU = "x86_64"; + $OS = "darwinlegacy"; + } # if not 64-bit, default is ok (i386-darwin). + } else { + ; # older version, default is ok (i386-darwin, powerpc-darwin). + } } elsif ($CPU =~ /^i.86$/) { $CPU = "i386"; # 586, 686, whatever @@ -328,24 +355,25 @@ sub platform_desc { 'armhf-linux' => 'GNU/Linux on ARMhf', 'hppa-hpux' => 'HP-UX', 'i386-cygwin' => 'Cygwin on Intel x86', - 'i386-darwin' => 'MacOSX/Darwin on Intel x86', + 'i386-darwin' => 'MacOSX legacy (10.5-10.6) on Intel x86', 'i386-freebsd' => 'FreeBSD on Intel x86', 'i386-kfreebsd' => 'GNU/kFreeBSD on Intel x86', - 'i386-openbsd' => 'OpenBSD on Intel x86', - 'i386-netbsd' => 'NetBSD on Intel x86', 'i386-linux' => 'GNU/Linux on Intel x86', + 'i386-netbsd' => 'NetBSD on Intel x86', + 'i386-openbsd' => 'OpenBSD on Intel x86', 'i386-solaris' => 'Solaris on Intel x86', 'mips-irix' => 'SGI IRIX', 'mipsel-linux' => 'GNU/Linux on MIPSel', 'powerpc-aix' => 'AIX on PowerPC', - 'powerpc-darwin' => 'MacOSX/Darwin on PowerPC', + 'powerpc-darwin' => 'MacOSX legacy (10.5) on PowerPC', 'powerpc-linux' => 'GNU/Linux on PowerPC', 'sparc-linux' => 'GNU/Linux on Sparc', 'sparc-solaris' => 'Solaris on Sparc', - 'universal-darwin' => 'MacOSX/Darwin universal binaries', + 'universal-darwin' => 'MacOSX universal binaries', 'win32' => 'Windows', 'x86_64-cygwin' => 'Cygwin on x86_64', - 'x86_64-darwin' => 'MacOSX/Darwin on x86_64', + 'x86_64-darwin' => 'MacOSX current on x86_64', + 'x86_64-darwinlegacy' => 'MacOSX legacy (10.6-10.9) on x86_64', 'x86_64-linux' => 'GNU/Linux on x86_64', 'x86_64-solaris' => 'Solaris on x86_64', ); @@ -4025,7 +4053,7 @@ sub setup_sys_user_mode { $texmfvar = $TEXMFVAR; } else { print STDERR "$prg [ERROR]: Either -user or -sys mode is required.\n" . - "See $TeXLive::TLConfig::SYSUSERURL for details!\n"; + "See http://tug.org/texlive/scripts-sys-user.html for details.\n"; exit(1); } return ($texmfconfig, $texmfvar); -- cgit v1.2.3