1 | --- src/port/port.tcl.orig Mon Aug 11 20:33:40 2003 |
---|
2 | +++ src/port/port.tcl Mon Aug 11 21:58:26 2003 |
---|
3 | @@ -172,6 +172,92 @@ |
---|
4 | } |
---|
5 | |
---|
6 | switch -- $action { |
---|
7 | + query-dependencies { |
---|
8 | + set nodeps true |
---|
9 | + |
---|
10 | + # make sure a port was given on the command line |
---|
11 | + if {![info exists portname]} { |
---|
12 | + puts "You must specify a port" |
---|
13 | + exit 1 |
---|
14 | + } |
---|
15 | + |
---|
16 | + # search for port |
---|
17 | + if {[catch {dportsearch ^$portname$} result]} { |
---|
18 | + puts "port search failed: $result" |
---|
19 | + exit 1 |
---|
20 | + } |
---|
21 | + |
---|
22 | + if {"$result" == ""} { |
---|
23 | + puts "No port $portname found." |
---|
24 | + exit 1 |
---|
25 | + } |
---|
26 | + |
---|
27 | + # an array is better than a list for this imho |
---|
28 | + array set portinfo [lindex $result 1] |
---|
29 | + |
---|
30 | + # find build dependencies |
---|
31 | + if {![catch {set depends_build $portinfo(depends_build)} result]} { |
---|
32 | + puts "$portname has build dependencies on:" |
---|
33 | + foreach i $depends_build { |
---|
34 | + puts "\t[lindex [split [lindex $i 0] :] 2]" |
---|
35 | + } |
---|
36 | + set nodeps false |
---|
37 | + } |
---|
38 | + |
---|
39 | + # find library dependencies |
---|
40 | + if {![catch {set depends_lib $portinfo(depends_lib)} result]} { |
---|
41 | + puts "$portname has library dependencies on:" |
---|
42 | + foreach i $depends_lib { |
---|
43 | + puts "\t[lindex [split [lindex $i 0] :] 2]" |
---|
44 | + } |
---|
45 | + set nodeps false |
---|
46 | + } |
---|
47 | + |
---|
48 | + # find runtime dependencies |
---|
49 | + if {![catch {set depends_run $portinfo(depends_run)} result]} { |
---|
50 | + puts "$portname has runtime dependencies on:" |
---|
51 | + foreach i $depends_run { |
---|
52 | + puts "\t[lindex [split [lindex $i 0] :] 2]" |
---|
53 | + } |
---|
54 | + set nodeps false |
---|
55 | + } |
---|
56 | + |
---|
57 | + # no dependencies found |
---|
58 | + if {"$nodeps" == "true"} { |
---|
59 | + puts "$portname has no dependencies" |
---|
60 | + } |
---|
61 | + } |
---|
62 | + query-variants { |
---|
63 | + # make sure a port was given on the command line |
---|
64 | + if {![info exists portname]} { |
---|
65 | + puts "You must specify a port" |
---|
66 | + exit 1 |
---|
67 | + } |
---|
68 | + |
---|
69 | + # search for port |
---|
70 | + if {[catch {dportsearch ^$portname$} result]} { |
---|
71 | + puts "port search failed: $result" |
---|
72 | + exit 1 |
---|
73 | + } |
---|
74 | + |
---|
75 | + if {"$result" == ""} { |
---|
76 | + puts "No port $portname found." |
---|
77 | + exit 1 |
---|
78 | + } |
---|
79 | + |
---|
80 | + # an array is better than a list for this imho |
---|
81 | + array set portinfo [lindex $result 1] |
---|
82 | + |
---|
83 | + # if this fails the port doesn't have any variants |
---|
84 | + if {[catch {set portvariants $portinfo(variants)} result]} { |
---|
85 | + puts "$portname has no variants" |
---|
86 | + } else { |
---|
87 | + # print out all the variants |
---|
88 | + for {set i 0} {$i < [llength $portvariants]} {incr i} { |
---|
89 | + puts "[lindex $portvariants $i]" |
---|
90 | + } |
---|
91 | + } |
---|
92 | + } |
---|
93 | search { |
---|
94 | if ![info exists portname] { |
---|
95 | puts "You must specify a search pattern" |
---|