Skip to content
Permalink
Browse files

Deprecate dportmatch in favor of dportsearch.

git-svn-id: https://svn.macports.org/repository/macports/trunk/base@1226 d073be05-634f-4543-b044-5fe20cf6d1d6
  • Loading branch information
Kevin Van Vechten
Kevin Van Vechten committed Nov 11, 2002
1 parent 28a05ba commit 499f37f57a5a60e09ba59971c93347f549b36673
Showing with 9 additions and 30 deletions.
  1. +3 −26 src/darwinports1.0/darwinports.tcl
  2. +3 −2 src/port/port.tcl
  3. +3 −2 src/port1.0/portutil.tcl
@@ -310,9 +310,9 @@ proc dportsearch {regexp} {
gets $fd line
array set portinfo $line
if [info exists portinfo(portarchive)] {
set portinfo(porturl) ${source}/$portinfo(portarchive)
lappend line porturl ${source}/$portinfo(portarchive)
} elseif [info exists portinfo(portdir)] {
set portinfo(porturl) ${source}/$portinfo(portdir)
lappend line porturl ${source}/$portinfo(portdir)
}
lappend matches $name
lappend matches $line
@@ -331,30 +331,7 @@ proc dportsearch {regexp} {
}

proc dportmatch {regexp} {
global darwinports::portdbpath darwinports::sources
foreach source $sources {
if {[catch {set fd [open [darwinports::getindex $source] r]} result]} {
return -code error "Can't open index file for source $source. Have you synced your source indexes?"
}
while {[gets $fd line] >= 0} {
set name [lindex $line 0]
if {[regexp -- $regexp $name] == 1} {
gets $fd line
array set portinfo $line
if [info exists portinfo(portarchive)] {
set portinfo(porturl) ${source}/$portinfo(portarchive)
} elseif [info exists portinfo(portdir)] {
set portinfo(porturl) ${source}/$portinfo(portdir)
}
close $fd
return [array get portinfo]
} else {
set len [lindex $line 1]
seek $fd $len current
}
}
close $fd
}
return -code error "dportmatch has been deprecated, use dportsearch instead."
}

proc dportinfo {workername} {
@@ -152,14 +152,15 @@ switch -- $action {
default {
set target $action
if {[info exists portname]} {
if {[catch {array set portinfo [dportmatch ^$portname\$]} result]} {
if {[catch {set res [dportsearch ^$portname\$]} result]} {
puts $result
exit 1
}
if {[array size portinfo] == 0} {
if {[llength $res] < 2} {
puts "Port $portname not found"
exit 1
}
array set portinfo [lindex $res 1]
set porturl $portinfo(porturl)
}
if ![info exists porturl] {
@@ -1076,11 +1076,12 @@ proc portfile_run {this} {
ui_debug "Building $portname"
array set options [list]
array set variations [list]
array set portinfo [dportmatch ^$portname\$]
if {[array size portinfo] == 0} {
set res [dportsearch ^$portname\$]
if {[llength $res] < 2} {
ui_error "Dependency $portname not found"
return -1
}
array set portinfo [lindex $res 1]
set porturl $portinfo(porturl)

set worker [dportopen $porturl options variations]

0 comments on commit 499f37f

Please sign in to comment.
You can’t perform that action at this time.