Changeset 4477 for trunk/base
- Timestamp:
- Jan 6, 2004, 8:03:50 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/base/src/port/port.tcl
r4098 r4477 178 178 # make sure a port was given on the command line 179 179 if {![info exists portname]} { 180 181 exit 1180 puts "You must specify a port" 181 exit 1 182 182 } 183 183 184 184 # search for port 185 185 if {[catch {dportsearch ^$portname$} result]} { 186 187 exit 1186 puts "port search failed: $result" 187 exit 1 188 188 } 189 189 … … 236 236 # make sure a port was given on the command line 237 237 if {![info exists portname]} { 238 239 exit 1240 } 241 238 puts "You must specify a port" 239 exit 1 240 } 241 242 242 # search for port 243 243 if {[catch {dportsearch ^$portname$} result]} { 244 245 exit 1246 } 247 244 puts "port search failed: $result" 245 exit 1 246 } 247 248 248 if {$result == ""} { 249 249 puts "No port $portname found." 250 250 } 251 251 252 252 array set portinfo [lindex $result 1] 253 253 254 254 # if this fails the port doesn't have any variants 255 255 if {![info exists portinfo(variants)]} { 256 256 puts "$portname has no variants" 257 257 } else { 258 258 # print out all the variants 259 259 for {set i 0} {$i < [llength $portinfo(variants)]} {incr i} { 260 260 puts "[lindex $portinfo(variants) $i]" … … 265 265 # make sure a port was given on the command line 266 266 if {![info exists portname]} { 267 268 exit 1269 } 270 267 puts "You must specify a port" 268 exit 1 269 } 270 271 271 set rfile [dportregistry::exists $portname] 272 272 if {$rfile != ""} { … … 278 278 set fd [open $rfile r] 279 279 } 280 set entry [read $fd] 280 281 while {-1 < [gets $fd line]} { 282 set match [regexp {^contents \{(.*)\}$} $line dummy contents] 283 if {$match == 1} { 284 puts "Contents of $shortname" 285 foreach f $contents { 286 puts "\t[lindex $f 0]" 287 } 288 break 289 } 290 } 291 292 if {$match == 0} { 293 puts "No contents list for $shortname" 294 exit 1 295 } 296 281 297 # kind of a corner case but I ran into it testing 282 298 if {[catch {close $fd} result]} { 283 299 puts "Port failed: $rfile may be corrupted" 284 exit 1 285 } 286 287 # look for a contents list 288 set ix [lsearch $entry contents] 289 if {$ix >= 0} { 290 set contents [lindex $entry [incr ix]] 291 set uninst_err 0 292 puts "Contents of $shortname" 293 foreach f $contents { 294 puts "\t[lindex $f 0]" 295 } 296 } else { 297 puts "No contents list for $shortname" 298 exit 1 300 exit 1 299 301 } 300 302 } else { … … 314 316 foreach {name array} $res { 315 317 array set portinfo $array 316 318 317 319 # XXX is this the right place to verify an entry? 318 320 if {![info exists portinfo(name)]} { … … 351 353 set target $action 352 354 if {[info exists portname]} { 353 354 355 # Escape regex special characters 356 regsub -all "(\\(){1}|(\\)){1}|(\\{1}){1}|(\\+){1}|(\\{1}){1}|(\\{){1}|(\\}){1}|(\\^){1}|(\\$){1}|(\\.){1}|(\\\\){1}" $portname "\\\\&" search_string 355 357 if {[catch {set res [dportsearch ^$search_string\$]} result]} { 356 358 puts "port search failed: $result" … … 375 377 exit 1 376 378 } 377 379 378 380 dportclose $workername 379 381 exit $result
Note: See TracChangeset
for help on using the changeset viewer.