Changeset 1429 for trunk/base


Ignore:
Timestamp:
Dec 13, 2002, 5:52:52 AM (17 years ago)
Author:
jpm
Message:

added a cap to the depth that portindex will probe into when searching
for portfiles. this change will eliminate performance issues with port
'work' directories - yay.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/port/portindex.tcl

    r1421 r1429  
    88
    99set archive 0
     10set depth 0
    1011
    1112# Standard procedures
     
    1819
    1920proc port_traverse {func {dir .} {cwd ""}} {
     21    global depth
    2022    set pwd [pwd]
    2123    if [catch {cd $dir} err] {
    22         puts $err
    23         return
     24            puts $err
     25            return
    2426    }
    2527    foreach name [readdir .] {
    26         if {[string match $name .] || [string match $name ..]} {
    27             continue
    28         }
    29         if [file isdirectory $name] {
    30             port_traverse $func $name [file join $cwd $name]
    31         } else {
    32             if [string match $name Portfile] {
    33                 $func $cwd
    34             }
    35         }
     28        if {[string match $name "."] || [string match $name ".."]} {
     29            continue
     30        }
     31        if {[file isdirectory $name] && $depth != 2} {
     32            incr depth 1
     33            port_traverse $func $name [file join $cwd $name]                   
     34            incr depth -1
     35        } else {
     36            if [string match $name Portfile] {
     37                $func $cwd
     38            }
     39        }
    3640    }
    3741    cd $pwd
Note: See TracChangeset for help on using the changeset viewer.