annotate CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/lib/thread2.8.8/pkgIndex.tcl @ 69:33d812a61356

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