Overview
Comment: | Skip adding temporary package directories if they do not contain an appropriate package index file. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | vNext |
Files: | files | file ages | folders |
SHA1: |
badaf4f7d968782a1ce76c9ce43689a1 |
User & Date: | test on 2022-02-20 15:47:26 |
Other Links: | branch diff | manifest | tags |
Context
2022-02-20
| ||
16:25 | Fix the settings file logic in two ways: 1) do not re-evaluate any settings file (via wildcard matching) that may have already been evaluated based on the list of prefixes. 2) always evaluate settings files relative to the (parent) script directory, not the current directory. check-in: eb868495e1 user: test tags: vNext | |
15:47 | Skip adding temporary package directories if they do not contain an appropriate package index file. check-in: badaf4f7d9 user: test tags: vNext | |
02:30 | Optionally allow reuse of temporary package directories. check-in: e5470474bd user: test tags: vNext | |
Changes
Modified client/1.0/neutral/pkgd.eagle from [d3a201ce4a] to [3216338fb7].
︙ | ︙ | |||
1776 1777 1778 1779 1780 1781 1782 | # a package index file. The language argument must be one of the # literal strings "eagle", "tcl", or "client". The fileNames argument # must be the list of file names to be downloaded. The package name, # if one can be detected, is returned; otherwise, an empty string will # be returned. # proc guessPackageNameFromFileNames { language fileNames } { | | | | | 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 | # a package index file. The language argument must be one of the # literal strings "eagle", "tcl", or "client". The fileNames argument # must be the list of file names to be downloaded. The package name, # if one can be detected, is returned; otherwise, an empty string will # be returned. # proc guessPackageNameFromFileNames { language fileNames } { set packageIndexFileNameOnly [getPackageIndexFileName $language] if {[string length $packageIndexFileNameOnly] > 0} then { foreach fileName $fileNames { set fileNameOnly [file tail $fileName] if {$fileNameOnly eq $packageIndexFileNameOnly} then { set directory [file dirname $fileName] if {[string length $directory] > 0} then { return [file tail $directory] } } } |
︙ | ︙ | |||
2206 2207 2208 2209 2210 2211 2212 | set downloadDirectories [list $persistentDirectory] } else { # # NOTE: Check each unique download directory for a package index # file. If a directory has a package index for the target # language, add to the auto-path for the target language. # | | | | | 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 | set downloadDirectories [list $persistentDirectory] } else { # # NOTE: Check each unique download directory for a package index # file. If a directory has a package index for the target # language, add to the auto-path for the target language. # set packageIndexFileNameOnly [getPackageIndexFileName $language] if {[string length $packageIndexFileNameOnly] > 0} then { foreach downloadDirectory $downloadDirectories { if {[file exists [file join \ $downloadDirectory $packageIndexFileNameOnly]]} then { addToAutoPath $language $downloadDirectory } } } } } |
︙ | ︙ | |||
2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 | # # NOTE: Initially, no temporary package directories have been added # to the auto-path. # set result [list]; set packageNames [list] # # HACK: Obtain the list of candidate temporary package directories # that may need to be added to the auto-path. The prefix we # use here is considered "well-known" by this package. # set directories(1) [glob -nocomplain -types {d} \ [file join $temporaryRootDirectory pkgd_lib_*]] foreach directory(1) $directories(1) { set directories(2) [glob -nocomplain -types {d} \ [file join $directory(1) *]] foreach directory(2) $directories(2) { set directoryNameOnly(2) [file tail $directory(2)] set packageName $directoryNameOnly(2); # HACK: Well-known. if {[lsearch -exact $packageNames $packageName] == -1} then { if {[string length $pattern] == 0 || \ [string match $pattern $directoryNameOnly(2)]} then { | > > > > > > > > > > > | | | | | | | > | 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 | # # NOTE: Initially, no temporary package directories have been added # to the auto-path. # set result [list]; set packageNames [list] # # NOTE: What is the package index file name for this language? Each # candidate temporary package directory will be checked to see # if it contains this file; otherwise, it will not be added to # the auto-path. # set packageIndexFileNameOnly [getPackageIndexFileName $language] # # HACK: Obtain the list of candidate temporary package directories # that may need to be added to the auto-path. The prefix we # use here is considered "well-known" by this package. # set directories(1) [glob -nocomplain -types {d} \ [file join $temporaryRootDirectory pkgd_lib_*]] foreach directory(1) $directories(1) { set directories(2) [glob -nocomplain -types {d} \ [file join $directory(1) *]] foreach directory(2) $directories(2) { set directoryNameOnly(2) [file tail $directory(2)] set packageName $directoryNameOnly(2); # HACK: Well-known. if {[lsearch -exact $packageNames $packageName] == -1} then { if {[string length $pattern] == 0 || \ [string match $pattern $directoryNameOnly(2)]} then { if {[string length $packageIndexFileNameOnly] == 0 || \ [file exists [file join $directory(2) \ $packageIndexFileNameOnly]]} then { if {[maybeAddToAutoPath $language $directory(2)]} then { lappend packageNames $directoryNameOnly(2) lappend result $directory(2) if {$verboseTemporaryDirectory} then { pkgLog [appendArgs \ "added temporary package directory named \"" \ $directory(2) "\" to auto-path..."] } } } } } } } |
︙ | ︙ |