develooper Front page | perl.perl5.porters | Postings from July 2019

[perl #134259] Faulty detection of macOS version in perl5.28

Thread Previous
Tony Cook via RT
July 3, 2019 05:54
[perl #134259] Faulty detection of macOS version in perl5.28
Message ID:
On Tue, 02 Jul 2019 16:40:36 -0700, wrote:
> According to one of our users the platform version detection on Darwin
> is not reliable.
> The log
> seems to report
>     Operating system version? [pro]
> which is likely due to some space in "uname -a" which usually reads
> something like
>     darwin mynames-macbook-pro.local 17.7.0 darwin kernel version
> 17.7.0: wed feb 27 00:43:23 pst 2019;
> root:xnu-4570.71.35~1release_x86_64 x86_64

A space in the host name seems kind of broken.  The code that extracts the version starts with:

	if $test -f $uname; then
		set X $myuname

The value of $uname is from uname -a lowercased by tr.  The set X ... and shift set $1 etc to the space separated values from that (shift removed the "X")

The code that I think ends up extracting the version on darwin is this fallback code:

		*)	case "$osname" in
			'') : Still unknown.  Probably a generic BSD.

For my system uname -a | tr 'A-Z' 'a-z' is:

darwin 17.7.0 darwin kernel version 17.7.0: wed apr 24 21:17:24 pdt 2019; root:xnu-4570.71.45~1/release_x86_64 x86_64

so $1 is "darwin" and $3 is 17.7.0

Maybe we'll need to add an extra guess to the list starting at

	: Half the following guesses are probably wrong... If you have better

though I'm not sure what filename we'd check.


via perlbug:  queue: perl5 status: new

Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About