Index: client/1.0/neutral/pkgd.eagle ================================================================== --- client/1.0/neutral/pkgd.eagle +++ client/1.0/neutral/pkgd.eagle @@ -1778,17 +1778,17 @@ # 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 packageIndexFileName [getPackageIndexFileName $language] + set packageIndexFileNameOnly [getPackageIndexFileName $language] - if {[string length $packageIndexFileName] > 0} then { + if {[string length $packageIndexFileNameOnly] > 0} then { foreach fileName $fileNames { set fileNameOnly [file tail $fileName] - if {$fileNameOnly eq $packageIndexFileName} then { + if {$fileNameOnly eq $packageIndexFileNameOnly} then { set directory [file dirname $fileName] if {[string length $directory] > 0} then { return [file tail $directory] } @@ -2208,16 +2208,16 @@ # # 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 packageIndexFileName [getPackageIndexFileName $language] + set packageIndexFileNameOnly [getPackageIndexFileName $language] - if {[string length $packageIndexFileName] > 0} then { + if {[string length $packageIndexFileNameOnly] > 0} then { foreach downloadDirectory $downloadDirectories { if {[file exists [file join \ - $downloadDirectory $packageIndexFileName]]} then { + $downloadDirectory $packageIndexFileNameOnly]]} then { addToAutoPath $language $downloadDirectory } } } } @@ -2258,10 +2258,18 @@ # 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. # @@ -2277,18 +2285,22 @@ 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 {[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..."] + 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..."] + } } } } } }