summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2025-08-25 15:34:57 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2025-08-25 15:34:57 (GMT)
commitac8205c8eed06a2a1ba2f3d3111601f454146e35 (patch)
treed2620cd654e441c2cd523f4e93fb66a1158c70a3
parent42725da7ba8157864eeb3c79a3cb3cfde0d8efb6 (diff)
parenta4b27124be697f98b62986258b44d1f0fdf3e697 (diff)
downloadtcl-ac8205c8eed06a2a1ba2f3d3111601f454146e35.zip
tcl-ac8205c8eed06a2a1ba2f3d3111601f454146e35.tar.gz
tcl-ac8205c8eed06a2a1ba2f3d3111601f454146e35.tar.bz2
Merge 9.0
-rw-r--r--library/manifest.txt2
-rw-r--r--library/platform/pkgIndex.tcl2
-rw-r--r--library/platform/platform.tcl105
-rw-r--r--tests/platform.test31
-rw-r--r--unix/Makefile.in4
-rw-r--r--win/Makefile.in4
6 files changed, 43 insertions, 105 deletions
diff --git a/library/manifest.txt b/library/manifest.txt
index ff46e3c..cbbb43a 100644
--- a/library/manifest.txt
+++ b/library/manifest.txt
@@ -9,7 +9,7 @@ apply {{dir} {
1 opt 0.4.9 {opt optparse.tcl}
0 cookiejar 0.2.0 {cookiejar cookiejar.tcl}
0 tcl::idna 1.0.1 {cookiejar idna.tcl}
- 0 platform 1.0.20 {platform platform.tcl}
+ 0 platform 1.1.0 {platform platform.tcl}
0 platform::shell 1.1.4 {platform shell.tcl}
1 tcltest 2.5.10 {tcltest tcltest.tcl}
} {
diff --git a/library/platform/pkgIndex.tcl b/library/platform/pkgIndex.tcl
index 20750be..8f0ee63 100644
--- a/library/platform/pkgIndex.tcl
+++ b/library/platform/pkgIndex.tcl
@@ -1,3 +1,3 @@
-package ifneeded platform 1.0.20 [list source -encoding utf-8 [file join $dir platform.tcl]]
+package ifneeded platform 1.1.0 [list source -encoding utf-8 [file join $dir platform.tcl]]
package ifneeded platform::shell 1.1.4 [list source -encoding utf-8 [file join $dir shell.tcl]]
diff --git a/library/platform/platform.tcl b/library/platform/platform.tcl
index e93e2df..bd175cd 100644
--- a/library/platform/platform.tcl
+++ b/library/platform/platform.tcl
@@ -123,7 +123,12 @@ proc ::platform::generic {} {
}
}
darwin {
- set plat macosx
+ set major [lindex [split $tcl_platform(osVersion) .] 0]
+ if {$major > 19} {
+ set plat macos
+ } else {
+ set plat macosx
+ }
# Correctly identify the cpu when running as a 64bit
# process on a machine with a 32bit kernel
if {$cpu eq "ix86"} {
@@ -171,24 +176,20 @@ proc ::platform::identify {} {
set id [generic]
regexp {^([^-]+)-([^-]+)$} $id -> plat cpu
- switch -- $plat {
+ switch -glob -- $plat {
solaris {
regsub {^5} $tcl_platform(osVersion) 2 text
append plat $text
return "${plat}-${cpu}"
}
- macosx {
+ macos* {
set major [lindex [split $tcl_platform(osVersion) .] 0]
if {$major > 19} {
- set minor [lindex [split $tcl_platform(osVersion) .] 1]
- incr major 1
+ incr major
if {$major < 26} {
incr major -10
}
- if {$major < 14} {
- incr minor -1
- }
- append plat $major.$minor
+ append plat $major
} else {
incr major -4
append plat 10.$major
@@ -343,9 +344,9 @@ proc ::platform::patterns {id} {
macosx-ix86 {
lappend res macosx-universal macosx-i386-x86_64
}
- macosx*-* {
+ macos*-* {
# 10.5+,11.0+
- if {[regexp {macosx([^-]*)-(.*)} $id -> v cpu]} {
+ if {[regexp {macosx?([^-]*)-(.*)} $id -> v cpu]} {
foreach {major minor} [split $v.15 .] break
switch -exact -- $cpu {
@@ -368,82 +369,16 @@ proc ::platform::patterns {id} {
if {$v ne ""} {
set res {}
- if {$major > 26} {
- # Add x.0 to x.minor to patterns.
- for {set j $minor} {$j >= 0} {incr j -1} {
- lappend res macosx${major}.${j}-${cpu}
- foreach a $alt {
- lappend res macosx${major}.${j}-$a
- }
+ while {$major > 10} {
+ # Add $major to patterns.
+ lappend res macos${major}-${cpu}
+ foreach a $alt {
+ lappend res macos${major}-$a
}
incr major -1
- set minor 5; # Assume that (major-1).5 will be there one day.
- }
- if {$major eq 26} {
- # Add 26.0 to 26.minor to patterns.
- for {set j $minor} {$j >= 0} {incr j -1} {
- lappend res macosx${major}.${j}-${cpu}
- foreach a $alt {
- lappend res macosx${major}.${j}-$a
- }
- }
- set major 15
- set minor 6
- }
- if {$major eq 15} {
- # Add 15.0 to 15.minor to patterns.
- for {set j $minor} {$j >= 0} {incr j -1} {
- lappend res macosx${major}.${j}-${cpu}
- foreach a $alt {
- lappend res macosx${major}.${j}-$a
- }
- }
- set major 14
- set minor 6
- }
- if {$major eq 14} {
- # Add 14.0 to 14.minor to patterns.
- for {set j $minor} {$j >= 0} {incr j -1} {
- lappend res macosx${major}.${j}-${cpu}
- foreach a $alt {
- lappend res macosx${major}.${j}-$a
- }
- }
- set major 13
- set minor 5
- }
- if {$major eq 13} {
- # Add 13.0 to 13.minor to patterns.
- for {set j $minor} {$j >= 0} {incr j -1} {
- lappend res macosx${major}.${j}-${cpu}
- foreach a $alt {
- lappend res macosx${major}.${j}-$a
- }
- }
- set major 12
- set minor 5
- }
- if {$major eq 12} {
- # Add 12.0 to 12.minor to patterns.
- for {set j $minor} {$j >= 0} {incr j -1} {
- lappend res macosx${major}.${j}-${cpu}
- foreach a $alt {
- lappend res macosx${major}.${j}-$a
- }
- }
- set major 11
- set minor 5
- }
- if {$major eq 11} {
- # Add 11.0 to 11.minor to patterns.
- for {set j $minor} {$j >= 0} {incr j -1} {
- lappend res macosx${major}.${j}-${cpu}
- foreach a $alt {
- lappend res macosx${major}.${j}-$a
- }
+ if {$major == 25} {
+ set major 15
}
- set major 10
- set minor 15
}
# Add 10.9 to 10.minor to patterns.
for {set j $minor} {$j >= 9} {incr j -1} {
@@ -492,7 +427,7 @@ proc ::platform::patterns {id} {
# ### ### ### ######### ######### #########
## Ready
-package provide platform 1.0.20
+package provide platform 1.1.0
# ### ### ### ######### ######### #########
## Demo application
diff --git a/tests/platform.test b/tests/platform.test
index 6a91410..5833a9f 100644
--- a/tests/platform.test
+++ b/tests/platform.test
@@ -33,8 +33,6 @@ test platform-1.0 {tcl_platform(engine)} {
test platform-1.1 {TclpSetVariables: tcl_platform} {
interp create i
- i eval {catch {unset tcl_platform(debug)}}
- i eval {catch {unset tcl_platform(threaded)}}
set result [i eval {lsort [array names tcl_platform]}]
interp delete i
set result
@@ -80,26 +78,31 @@ test platform-5.0 {format of platform::generic result} -setup {
set ::tcl_platform(machine) arm
set ::tcl_platform(os) Darwin
set ::tcl_platform(wordSize) 8
- set ::tcl_platform(osVersion) 20.1
} -body {
set res {}
- set id [platform::identify]
- lappend res $id
- lappend res [platform::patterns $id]
+ set l {macosx10.15-x86_64 macosx10.14-x86_64 macosx10.13-x86_64 macosx10.12-x86_64 macosx10.11-x86_64 macosx10.10-x86_64 macosx10.9-x86_64 tcl}
+ foreach v {20.0 21.0 22.0 23.0 24.0 25.0 26.0} {
+ set ::tcl_platform(osVersion) $v
+ set id [platform::identify]
+ set l [linsert $l 0 [string range $id 0 end-4]-x86_64]
+ set l [linsert $l 0 $id]
+ lappend res $id
+ lappend res [expr {($l eq [platform::patterns $id]) ? 1 : [platform::patterns $id]}]
+ }
set res
} -cleanup {
set ::tcl_platform(machine) $old_machine
set ::tcl_platform(os) $old_os
set ::tcl_platform(wordSize) $old_wordsize
set ::tcl_platform(osVersion) $old_version
- unset res old_machine old_os old_wordsize old_version
-} -result {macosx11.0-arm {macosx11.0-arm macosx11.0-x86_64 macosx10.15-x86_64 macosx10.14-x86_64 macosx10.13-x86_64 macosx10.12-x86_64 macosx10.11-x86_64 macosx10.10-x86_64 macosx10.9-x86_64 tcl}}
-test platform-5.1 {format of platform::patterns macosx11.0-x86_64} -body {
- platform::patterns macosx11.0-x86_64
-} -result {macosx11.0-x86_64 macosx10.15-x86_64 macosx10.14-x86_64 macosx10.14-i386-x86_64 macosx10.13-x86_64 macosx10.13-i386-x86_64 macosx10.12-x86_64 macosx10.12-i386-x86_64 macosx10.11-x86_64 macosx10.11-i386-x86_64 macosx10.10-x86_64 macosx10.10-i386-x86_64 macosx10.9-x86_64 macosx10.9-i386-x86_64 tcl}
-test platform-5.2 {format of platform::patterns macosx11.0-arm} -body {
- platform::patterns macosx11.0-arm
-} -result {macosx11.0-arm macosx11.0-x86_64 macosx10.15-x86_64 macosx10.14-x86_64 macosx10.13-x86_64 macosx10.12-x86_64 macosx10.11-x86_64 macosx10.10-x86_64 macosx10.9-x86_64 tcl}
+ unset res l old_machine old_os old_wordsize old_version
+} -result {macos11-arm 1 macos12-arm 1 macos13-arm 1 macos14-arm 1 macos15-arm 1 macos26-arm 1 macos27-arm 1}
+test platform-5.1 {format of platform::patterns macos26-x86_64} -body {
+ platform::patterns macos26-x86_64
+} -result {macos26-x86_64 macos15-x86_64 macos14-x86_64 macos13-x86_64 macos12-x86_64 macos11-x86_64 macosx10.15-x86_64 macosx10.14-x86_64 macosx10.14-i386-x86_64 macosx10.13-x86_64 macosx10.13-i386-x86_64 macosx10.12-x86_64 macosx10.12-i386-x86_64 macosx10.11-x86_64 macosx10.11-i386-x86_64 macosx10.10-x86_64 macosx10.10-i386-x86_64 macosx10.9-x86_64 macosx10.9-i386-x86_64 tcl}
+test platform-5.2 {format of platform::patterns macos26-arm} -body {
+ platform::patterns macos26-arm
+} -result {macos26-arm macos26-x86_64 macos15-arm macos15-x86_64 macos14-arm macos14-x86_64 macos13-arm macos13-x86_64 macos12-arm macos12-x86_64 macos11-arm macos11-x86_64 macosx10.15-x86_64 macosx10.14-x86_64 macosx10.13-x86_64 macosx10.12-x86_64 macosx10.11-x86_64 macosx10.10-x86_64 macosx10.9-x86_64 tcl}
# cleanup
cleanupTests
diff --git a/unix/Makefile.in b/unix/Makefile.in
index 0d5a431..194f17c 100644
--- a/unix/Makefile.in
+++ b/unix/Makefile.in
@@ -1085,9 +1085,9 @@ install-libraries: libraries
@echo "Installing package tcltest 2.5.10 as a Tcl Module"
@$(INSTALL_DATA) $(TOP_DIR)/library/tcltest/tcltest.tcl \
"$(MODULE_INSTALL_DIR)/9.0/tcltest-2.5.10.tm"
- @echo "Installing package platform 1.0.20 as a Tcl Module"
+ @echo "Installing package platform 1.1.0 as a Tcl Module"
@$(INSTALL_DATA) $(TOP_DIR)/library/platform/platform.tcl \
- "$(MODULE_INSTALL_DIR)/9.0/platform-1.0.20.tm"
+ "$(MODULE_INSTALL_DIR)/9.0/platform-1.1.0.tm"
@echo "Installing package platform::shell 1.1.4 as a Tcl Module"
@$(INSTALL_DATA) $(TOP_DIR)/library/platform/shell.tcl \
"$(MODULE_INSTALL_DIR)/9.0/platform/shell-1.1.4.tm"
diff --git a/win/Makefile.in b/win/Makefile.in
index d0e264a..4f1d8ef 100644
--- a/win/Makefile.in
+++ b/win/Makefile.in
@@ -931,8 +931,8 @@ install-libraries: libraries install-tzdata install-msgs
@$(COPY) $(ROOT_DIR)/library/msgcat/msgcat.tcl "$(MODULE_INSTALL_DIR)/9.0/msgcat-1.7.1.tm";
@echo "Installing package tcltest 2.5.10 as a Tcl Module";
@$(COPY) $(ROOT_DIR)/library/tcltest/tcltest.tcl "$(MODULE_INSTALL_DIR)/9.0/tcltest-2.5.10.tm";
- @echo "Installing package platform 1.0.20 as a Tcl Module";
- @$(COPY) $(ROOT_DIR)/library/platform/platform.tcl "$(MODULE_INSTALL_DIR)/9.0/platform-1.0.20.tm";
+ @echo "Installing package platform 1.1.0 as a Tcl Module";
+ @$(COPY) $(ROOT_DIR)/library/platform/platform.tcl "$(MODULE_INSTALL_DIR)/9.0/platform-1.1.0.tm";
@echo "Installing package platform::shell 1.1.4 as a Tcl Module";
@$(COPY) $(ROOT_DIR)/library/platform/shell.tcl "$(MODULE_INSTALL_DIR)/9.0/platform/shell-1.1.4.tm";
@echo "Installing encodings";