Mon Jun 29 12:38:03 2020 UTC ()
bootstrap: Overhaul Darwin version selection.

With the upcoming Big Sur release we can't assume that the major version will
always be 10.  Creating a combined major and minor version number also allows
us to simplify and future-proof some tests.

Should be no functional change.


(jperkin)
diff -r1.282 -r1.283 pkgsrc/bootstrap/bootstrap

cvs diff -r1.282 -r1.283 pkgsrc/bootstrap/bootstrap (expand / switch to unified diff)

--- pkgsrc/bootstrap/bootstrap 2020/06/29 12:01:38 1.282
+++ pkgsrc/bootstrap/bootstrap 2020/06/29 12:38:03 1.283
@@ -1,16 +1,16 @@ @@ -1,16 +1,16 @@
1#! /bin/sh 1#! /bin/sh
2 2
3# $NetBSD: bootstrap,v 1.282 2020/06/29 12:01:38 jperkin Exp $ 3# $NetBSD: bootstrap,v 1.283 2020/06/29 12:38:03 jperkin Exp $
4# 4#
5# Copyright (c) 2001-2011 Alistair Crooks <agc@NetBSD.org> 5# Copyright (c) 2001-2011 Alistair Crooks <agc@NetBSD.org>
6# All rights reserved. 6# All rights reserved.
7# 7#
8# Redistribution and use in source and binary forms, with or without 8# Redistribution and use in source and binary forms, with or without
9# modification, are permitted provided that the following conditions 9# modification, are permitted provided that the following conditions
10# are met: 10# are met:
11# 1. Redistributions of source code must retain the above copyright 11# 1. Redistributions of source code must retain the above copyright
12# notice, this list of conditions and the following disclaimer. 12# notice, this list of conditions and the following disclaimer.
13# 2. Redistributions in binary form must reproduce the above copyright 13# 2. Redistributions in binary form must reproduce the above copyright
14# notice, this list of conditions and the following disclaimer in the 14# notice, this list of conditions and the following disclaimer in the
15# documentation and/or other materials provided with the distribution. 15# documentation and/or other materials provided with the distribution.
16# 16#
@@ -563,54 +563,55 @@ CYGWIN_*) @@ -563,54 +563,55 @@ CYGWIN_*)
563 return 0 563 return 0
564 fi 564 fi
565 return 1 565 return 1
566 } 566 }
567 root_user=Administrators 567 root_user=Administrators
568 root_group=Administrators 568 root_group=Administrators
569 opsys=`uname -o` 569 opsys=`uname -o`
570 need_sed=yes 570 need_sed=yes
571 machine_arch=`uname -m` 571 machine_arch=`uname -m`
572 # only used for unprivileged builds. 572 # only used for unprivileged builds.
573 whoamiprog='id -u' 573 whoamiprog='id -u'
574 groupsprog='id -g' 574 groupsprog='id -g'
575 ;; 575 ;;
576 
577Darwin) 576Darwin)
578 root_group=wheel 577 root_group=wheel
579 need_awk=yes 
580 need_sed=yes 
581 machine_arch=`get_machine_arch_darwin` 578 machine_arch=`get_machine_arch_darwin`
582 CC=${CC:-"cc -isystem /usr/include"}; export CC 579 CC=${CC:-"cc -isystem /usr/include"}; export CC
583 check_compiler=yes 580 check_compiler=yes
584 osrev=`uname -r` 581 osrev=`uname -r`
585 macosx_version=`echo $osrev | awk -F . '{ print "10."$1-4; }'` 582
586 case "$macosx_version" in 583 # Combine major.minor product version for simpler numerical tests.
587 10.[7-9]) 584 macos_version=`sw_vers -productVersion | awk -F. '{print $1 $2}'`
 585
 586 # Newer native sed does not support multibyte correctly.
 587 if [ $macos_version -ge 1008 ]; then
 588 need_awk=yes
 589 need_sed=yes
 590 fi
 591
 592 case "$macos_version" in
 593 100[7-9])
588 packagemaker=/Applications/PackageMaker.app/Contents/MacOS/PackageMaker 594 packagemaker=/Applications/PackageMaker.app/Contents/MacOS/PackageMaker
589 ;; 595 ;;
590 10.[0-4]) 596 100[0-4])
591 packagemaker=/Developer/Tools/packagemaker 597 packagemaker=/Developer/Tools/packagemaker
592 ;; 598 ;;
593 *) 599 *)
594 packagemaker=/Developer/usr/bin/packagemaker 600 packagemaker=/Developer/usr/bin/packagemaker
595 ;; 601 ;;
596 esac 602 esac
597 case "$macosx_version" in 603
598 10.[0-7]) 604 unset osrev macos_version
599 need_awk=no 
600 need_sed=no 
601 ;; 
602 esac 
603 unset osrev macosx_version 
604 ;; 605 ;;
605DragonFly) 606DragonFly)
606 root_group=wheel 607 root_group=wheel
607 check_prog tarprog tar 608 check_prog tarprog tar
608 machine_arch=`uname -p` 609 machine_arch=`uname -p`
609 ;; 610 ;;
610FreeBSD) 611FreeBSD)
611 root_group=wheel 612 root_group=wheel
612 machine_arch=`uname -p` 613 machine_arch=`uname -p`
613 check_compiler=yes 614 check_compiler=yes
614 ;; 615 ;;
615FreeMiNT) 616FreeMiNT)
616 root_group=root 617 root_group=root