annotate CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/lib/thread2.8.8/pkgIndex.tcl @ 68:5028fdace37b

planemo upload commit 2e9511a184a1ca667c7be0c6321a36dc4e3d116d
author jpayne
date Tue, 18 Mar 2025 16:23:26 -0400
parents
children
rev   line source
jpayne@68 1 # -*- tcl -*-
jpayne@68 2 # Tcl package index file, version 1.1
jpayne@68 3 #
jpayne@68 4
jpayne@68 5 if {![package vsatisfies [package provide Tcl] 8.4]} {
jpayne@68 6 # Pre-8.4 Tcl interps we dont support at all. Bye!
jpayne@68 7 # 9.0+ Tcl interps are only supported on 32-bit platforms.
jpayne@68 8 if {![package vsatisfies [package provide Tcl] 9.0]
jpayne@68 9 || ($::tcl_platform(pointerSize) != 4)} {
jpayne@68 10 return
jpayne@68 11 }
jpayne@68 12 }
jpayne@68 13
jpayne@68 14 # All Tcl 8.4+ interps can [load] Thread 2.8.8
jpayne@68 15 #
jpayne@68 16 # For interps that are not thread-enabled, we still call [package ifneeded].
jpayne@68 17 # This is contrary to the usual convention, but is a good idea because we
jpayne@68 18 # cannot imagine any other version of Thread that might succeed in a
jpayne@68 19 # thread-disabled interp. There's nothing to gain by yielding to other
jpayne@68 20 # competing callers of [package ifneeded Thread]. On the other hand,
jpayne@68 21 # deferring the error has the advantage that a script calling
jpayne@68 22 # [package require Thread] in a thread-disabled interp gets an error message
jpayne@68 23 # about a thread-disabled interp, instead of the message
jpayne@68 24 # "can't find package Thread".
jpayne@68 25
jpayne@68 26 package ifneeded Thread 2.8.8 [list load [file join $dir libthread2.8.8.so] [string totitle thread]]
jpayne@68 27
jpayne@68 28 # package Ttrace uses some support machinery.
jpayne@68 29
jpayne@68 30 # In Tcl 8.4 interps we use some older interfaces
jpayne@68 31 if {![package vsatisfies [package provide Tcl] 8.5]} {
jpayne@68 32 package ifneeded Ttrace 2.8.8 "
jpayne@68 33 [list proc thread_source {dir} {
jpayne@68 34 if {[info exists ::env(TCL_THREAD_LIBRARY)] &&
jpayne@68 35 [file readable $::env(TCL_THREAD_LIBRARY)/ttrace.tcl]} {
jpayne@68 36 source $::env(TCL_THREAD_LIBRARY)/ttrace.tcl
jpayne@68 37 } elseif {[file readable [file join $dir .. lib ttrace.tcl]]} {
jpayne@68 38 source [file join $dir .. lib ttrace.tcl]
jpayne@68 39 } elseif {[file readable [file join $dir ttrace.tcl]]} {
jpayne@68 40 source [file join $dir ttrace.tcl]
jpayne@68 41 }
jpayne@68 42 if {[namespace which ::ttrace::update] ne ""} {
jpayne@68 43 ::ttrace::update
jpayne@68 44 }
jpayne@68 45 }]
jpayne@68 46 [list thread_source $dir]
jpayne@68 47 [list rename thread_source {}]"
jpayne@68 48 return
jpayne@68 49 }
jpayne@68 50
jpayne@68 51 # In Tcl 8.5+ interps; use [::apply]
jpayne@68 52
jpayne@68 53 package ifneeded Ttrace 2.8.8 [list ::apply {{dir} {
jpayne@68 54 if {[info exists ::env(TCL_THREAD_LIBRARY)] &&
jpayne@68 55 [file readable $::env(TCL_THREAD_LIBRARY)/ttrace.tcl]} {
jpayne@68 56 source $::env(TCL_THREAD_LIBRARY)/ttrace.tcl
jpayne@68 57 } elseif {[file readable [file join $dir .. lib ttrace.tcl]]} {
jpayne@68 58 source [file join $dir .. lib ttrace.tcl]
jpayne@68 59 } elseif {[file readable [file join $dir ttrace.tcl]]} {
jpayne@68 60 source [file join $dir ttrace.tcl]
jpayne@68 61 }
jpayne@68 62 if {[namespace which ::ttrace::update] ne ""} {
jpayne@68 63 ::ttrace::update
jpayne@68 64 }
jpayne@68 65 }} $dir]
jpayne@68 66
jpayne@68 67
jpayne@68 68