2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
|
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
|
-
+
-
+
-
+
+
+
+
+
-
-
+
+
+
+
-
+
-
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
# NOTE: This procedure evaluates the package repository client settings
# script file, if it exists. Any script errors raised are not
# masked. The script argument must be the fully qualified path
# and file name for the primary package repository client script
# file.
#
# <public>
proc maybeReadSettingsFile { script } {
proc maybeReadSettingsFiles { script } {
global env
global tcl_platform
if {[string length $script] == 0 || \
![file exists $script] || ![file isfile $script]} then {
return
return -1
}
set scriptName [string toupper [file rootname [file tail $script]]]
set scriptTail [file tail $script]
set scriptRootName [file rootname $scriptTail]
set scriptExtension [file extension $scriptTail]
set scriptUpperName [string toupper $scriptRootName]
set scriptLowerName [string tolower $scriptRootName]
if {[info exists [appendArgs env(NO_SETTINGS_ $scriptName )]]} then {
return
if {[info exists [appendArgs \
env(NO_SETTINGS_ $scriptUpperName )]]} then {
return -2
}
set count 0
set prefixes [list]
if {[info exists tcl_platform(user)]} then {
lappend prefixes $tcl_platform(user)
}
if {[catch {info hostname} hostName] == 0 && \
[string length $hostName] > 0} then {
lappend prefixes $hostName
}
lappend prefixes [string tolower $scriptName]
lappend prefixes $scriptLowerName
if {[info exists [appendArgs env(DEBUG_ $scriptName )]]} then {
if {[info exists [appendArgs \
env(DEBUG_ $scriptUpperName )]]} then {
lappend prefixes debug
}
lappend prefixes ""
foreach prefix $prefixes {
if {[string length $prefix] > 0} then {
set prefix [appendArgs . $prefix]
}
set fileName [appendArgs \
[file rootname $script] .settings $prefix [file extension \
$script]]
if {[file exists $fileName] && [file isfile $fileName]} then {
uplevel 1 [list source $fileName]
}
}
$scriptRootName .settings $prefix $scriptExtension]
if {[file exists $fileName] && [file isfile $fileName]} then {
uplevel 1 [list source $fileName]; incr count
}
}
if {$count == 0} then {
set pattern [file join [file normalize [file dirname $script]] \
[appendArgs $scriptRootName .settings.* $scriptExtension]]
foreach fileName [glob -nocomplain -- $pattern] {
if {[file exists $fileName] && [file isfile $fileName]} then {
uplevel 1 [list source $fileName]; incr count
}
}
}
return $count
}
#
# NOTE: This procedure evaluates a package repository client API keys
# script file, if it has been configured -AND- actually exists.
# Any script errors raised are not masked. The evaluated script
# file should (normally) modify the "::pkgr_api_keys" variable
|
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
|
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
|
-
+
|
error "namespaces must be enabled for this package"
}
#
# NOTE: Attempt to read optional settings file now. This may override
# one or more of the variable setup in the next step.
#
maybeReadSettingsFile [info script]
maybeReadSettingsFiles [info script]
#
# NOTE: Attempt to read optional API keys file now. This may add API
# keys for use by this script.
#
maybeReadApiKeysFile
|