Ignore:
Timestamp:
Nov 11, 2002, 9:11:24 AM (18 years ago)
Author:
kevin
Message:

Deprecate dportmatch in favor of dportsearch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/darwinports1.0/darwinports.tcl

    r1169 r1226  
    311311                array set portinfo $line
    312312                if [info exists portinfo(portarchive)] {
    313                     set portinfo(porturl) ${source}/$portinfo(portarchive)
     313                    lappend line porturl ${source}/$portinfo(portarchive)
    314314                } elseif [info exists portinfo(portdir)] {
    315                     set portinfo(porturl) ${source}/$portinfo(portdir)
     315                    lappend line porturl ${source}/$portinfo(portdir)
    316316                }
    317317                lappend matches $name
     
    332332
    333333proc dportmatch {regexp} {
    334     global darwinports::portdbpath darwinports::sources
    335     foreach source $sources {
    336         if {[catch {set fd [open [darwinports::getindex $source] r]} result]} {
    337             return -code error "Can't open index file for source $source. Have you synced your source indexes?"
    338         }
    339         while {[gets $fd line] >= 0} {
    340             set name [lindex $line 0]
    341             if {[regexp -- $regexp $name] == 1} {
    342                 gets $fd line
    343                 array set portinfo $line
    344                 if [info exists portinfo(portarchive)] {
    345                     set portinfo(porturl) ${source}/$portinfo(portarchive)
    346                 } elseif [info exists portinfo(portdir)] {
    347                     set portinfo(porturl) ${source}/$portinfo(portdir)
    348                 }
    349                 close $fd
    350                 return [array get portinfo]
    351             } else {
    352                 set len [lindex $line 1]
    353                 seek $fd $len current
    354             }
    355         }
    356         close $fd
    357     }
     334        return -code error "dportmatch has been deprecated, use dportsearch instead."
    358335}
    359336
Note: See TracChangeset for help on using the changeset viewer.