Diff
Not logged in

Differences From Artifact [d3a201ce4a]:

To Artifact [3216338fb7]:


1778
1779
1780
1781
1782
1783

1784
1785

1786
1787
1788
1789

1790
1791
1792
1793
1794
1778
1779
1780
1781
1782

1783
1784

1785
1786
1787
1788

1789
1790
1791
1792
1793
1794





-
+

-
+



-
+





  #       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
2209
2210
2211
2212
2213

2214
2215

2216
2217
2218

2219
2220
2221
2222
2223
2208
2209
2210
2211
2212

2213
2214

2215
2216
2217

2218
2219
2220
2221
2222
2223





-
+

-
+


-
+





        # 
        # 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
2259
2260
2261
2262








2263
2264
2265
2266
2267
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275





+
+
+
+
+
+
+
+





    # 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
2278
2279
2280
2281



2282
2283
2284



2285
2286
2287
2288
2289





2290
2291
2292
2293
2294
2285
2286
2287
2288
2289
2290
2291
2292



2293
2294
2295
2296




2297
2298
2299
2300
2301
2302
2303
2304
2305
2306





+
+
+
-
-
-
+
+
+

-
-
-
-
+
+
+
+
+





        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 {[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 {$verboseTemporaryDirectory} then { 
                  pkgLog [appendArgs \ 
                      "added temporary package directory named \"" \ 
                      $directory(2) "\" to auto-path..."] 
                } 
              } 
            } 
          } 
        } 
      }