summaryrefslogtreecommitdiff
path: root/Master/tlpkg/TeXLive
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-04-18 21:52:56 +0000
committerKarl Berry <karl@freefriends.org>2020-04-18 21:52:56 +0000
commitbc06872f401b88bc9f33d963593db77c0184e847 (patch)
tree2a2b6fcbeb68a1fa204315625f9f7047bceef7b3 /Master/tlpkg/TeXLive
parentd78e6233eeb68d23f8deb17e16a3f3b828e35beb (diff)
(platform_name, platform_desc): support amd64-unknown-midnightbsd1.2,
request from Nelson, 17 Apr 2020 18:35:47. Also, if the envvar TEXLIVE_OS_NAME is set, use it as-is. git-svn-id: svn://tug.org/texlive/trunk@54790 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/TeXLive')
-rw-r--r--Master/tlpkg/TeXLive/TLUtils.pm32
1 files changed, 19 insertions, 13 deletions
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm
index ed99a4d2918..ab1f6c99ddc 100644
--- a/Master/tlpkg/TeXLive/TLUtils.pm
+++ b/Master/tlpkg/TeXLive/TLUtils.pm
@@ -282,11 +282,10 @@ by C<i386>.
For the OS value we need a list because what's returned is not likely to
match our historical names, e.g., C<config.guess> returns C<linux-gnu>
-but we need C<linux>. This list contains old OSs which are not currently
+but we need C<linux>. This list contains old OSs which are no longer
supported, just in case.
-If a particular platform is not found in this list we use the regexp
-C</.*-(.*$)/> as a last resort and hope it provides something useful.
+If the environment variable TEXLIVE_OS_NAME is set, it is used as-is.
=cut
@@ -295,6 +294,8 @@ sub platform_name {
my $guessed_platform = $orig_platform;
# try to parse out some bsd variants that use amd64.
+ # We throw away everything after the "bsd" to elide version numbers,
+ # as in amd64-unknown-midnightbsd1.2.
$guessed_platform =~ s/^x86_64-(.*-k?)(free|net)bsd/amd64-$1$2bsd/;
my $CPU; # CPU type as reported by config.guess.
my $OS; # O/S type as reported by config.guess.
@@ -311,16 +312,20 @@ sub platform_name {
$CPU = $guessed_platform =~ /hf$/ ? "armhf" : "armel";
}
- my @OSs = qw(aix cygwin darwin dragonfly freebsd hpux irix
- kfreebsd linux netbsd openbsd solaris);
- for my $os (@OSs) {
- # Match word boundary at the beginning of the os name so that
- # freebsd and kfreebsd are distinguished.
- # Do not match word boundary at the end of the os so that
- # solaris2 is matched.
- $OS = $os if $guessed_platform =~ /\b$os/;
- }
-
+ if ($ENV{"TEXLIVE_OS_NAME"}) {
+ $OS = $ENV{"TEXLIVE_OS_NAME"};
+ } else {
+ my @OSs = qw(aix cygwin darwin dragonfly freebsd hpux irix
+ kfreebsd linux midnightbsd netbsd openbsd solaris);
+ for my $os (@OSs) {
+ # Match word boundary at the beginning of the os name so that
+ # freebsd and kfreebsd are distinguished.
+ # Do not match word boundary at the end of the os so that
+ # solaris2 is matched.
+ $OS = $os if $guessed_platform =~ /\b$os/;
+ }
+ }
+
if (! $OS) {
warn "$0: could not guess OS from config.guess string: $orig_platform";
$OS = "unknownOS";
@@ -398,6 +403,7 @@ sub platform_desc {
'alpha-linux' => 'GNU/Linux on DEC Alpha',
'amd64-freebsd' => 'FreeBSD on x86_64',
'amd64-kfreebsd' => 'GNU/kFreeBSD on x86_64',
+ 'amd64-midnightbsd'=> 'MidnightBSD on x86_64',
'amd64-netbsd' => 'NetBSD on x86_64',
'armel-linux' => 'GNU/Linux on ARM',
'armhf-linux' => 'GNU/Linux on ARMv6/RPi',