523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
|
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
|
-
+
-
+
|
} else {
return ""
}
}
#
# NOTE: This procedure, which is only used for native Tcl, generates a
# "master" package index file (i.e. "pkgIndex.tcl") suitable for
# "root" package index file (i.e. "pkgIndex.tcl") suitable for
# use with native Tcl 8.4 (or higher). It will recursively scan
# for all other native Tcl package index files that are within the
# configured persistent root directory and [source] them, thereby
# causing all packages located within them to become available.
# Since Eagle (by default) already performs recursive searches for
# its package index files, this procedure is not needed for Eagle.
# The return value is undefined.
#
proc maybeCreateMasterTclPackageIndex {} {
proc maybeCreateRootTclPackageIndex {} {
variable persistentRootDirectory
verifyPersistentRootDirectory
set persistentDirectory $persistentRootDirectory
set fileName [file join $persistentDirectory pkgIndex.tcl]
if {[file exists $fileName]} then {return ""}
|
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
|
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
|
-
+
|
}
return $::auto_path
}
}
} elseif {$language eq "tcl"} then {
if {[isEagle]} then {
tcl eval [tcl master] {
tcl eval [tcl primary] {
if {![info exists ::auto_path]} then {
return [list]
}
return $::auto_path
}
} else {
|
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
|
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
|
-
+
|
[lsearch -exact $::auto_path {%directory%}] == -1} then {
lappend ::auto_path {%directory%}
}
}]
}
} elseif {$language eq "tcl"} then {
if {[isEagle]} then {
tcl eval [tcl master] [string map [list %directory% $directory] {
tcl eval [tcl primary] [string map [list %directory% $directory] {
if {![info exists ::auto_path] || \
[lsearch -exact $::auto_path {%directory%}] == -1} then {
lappend ::auto_path {%directory%}
}
}]
} else {
if {![info exists ::auto_path] || \
|
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
|
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
|
-
+
-
+
-
+
|
file delete -recursive -- $temporaryDirectory
} else {
file delete -force -- $temporaryDirectory
}
#
# NOTE: When the target language is native Tcl, try to create the
# master package index, if necessary.
# "root" package index, if necessary.
#
if {$language eq "tcl"} then {
maybeCreateMasterTclPackageIndex
maybeCreateRootTclPackageIndex
set addPersistentDirectoryToAutoPath true
}
}
#
# NOTE: Sort the list of directories that downloaded files were written
# to, removing any duplicates in the process.
#
set downloadDirectories [lsort -unique $downloadDirectories]
if {$useAutoPath} then {
#
# NOTE: The auto-path, for whatever language this package belongs to,
# needs to be modified.
#
if {$addPersistentDirectoryToAutoPath} then {
#
# NOTE: The downloaded package was persisted -AND- will be handled
# by the master package index; therefore, just make sure the
# by the "root" package index; therefore, just make sure the
# package persistence root directory is in the auto-path and
# then return only that directory in the result.
#
maybeAddToAutoPath $language $persistentDirectory
set downloadDirectories [list $persistentDirectory]
} else {
#
|