Add 'rleaves' alias

This commit is contained in:
Dan Villiom Podlaski Christiansen
2017-02-17 22:26:48 +01:00
parent 0e729c045a
commit b042c0e754
3 changed files with 34 additions and 0 deletions
+11
View File
@@ -162,6 +162,17 @@ When passing \fIportnames\fR to an \fIaction\fR, \fBport\fR recognizes various \
\fIleaves\fR: installed ports that are unrequested and have no dependents
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fIrleaves\fR: installed ports that are unrequested and that no requested ports depend on
.RE
.sp
Sets of ports can also be specified with \fIpseudo\-portname selectors\fR, which expand to the ports in which the value of the \fIPortfile\fR option corresponding to the selector\(cqs name (in either singular or plural form where applicable) matches the given regular expression\&. Usage is: selector:regex
.PP
\fBThe \fR\fB\fIpseudo\-portname selectors\fR\fR\fB are:\fR
+2
View File
@@ -52,6 +52,8 @@ available port tree(s). These may be used in the same way as a 'portname'.
- 'unrequested': installed ports that were installed only to satisfy
dependencies
- 'leaves': installed ports that are unrequested and have no dependents
- 'rleaves': installed ports that are unrequested and that no
requested ports depend on
Sets of ports can also be specified with 'pseudo-portname selectors', which
expand to the ports in which the value of the 'Portfile' option corresponding
Regular → Executable
+21
View File
@@ -934,6 +934,26 @@ proc get_leaves_ports {} {
return [portlist_sort [opIntersection $results [get_unrequested_ports]]]
}
proc get_rleaves_ports {} {
if { [catch {set ilist [get_unrequested_ports]} result] } {
if {$result ne "Registry error: No ports registered as installed."} {
ui_debug $::errorInfo
fatal "port installed failed: $result"
}
}
registry::open_dep_map
set requested [get_requested_ports]
set results {}
foreach i $ilist {
set iname [lindex $i 9]
set deplist [get_dependent_ports $iname 1]
if {$deplist eq "" || [opIntersection $deplist $requested] eq ""} {
add_to_portlist results $i
}
}
return [portlist_sort $results]
}
proc get_dependent_ports {portname recursive} {
registry::open_dep_map
set deplist [registry::list_dependents $portname]
@@ -1295,6 +1315,7 @@ proc element { resname } {
^(inactive)(@.*)?$ -
^(actinact)(@.*)?$ -
^(leaves)(@.*)?$ -
^(rleaves)(@.*)?$ -
^(outdated)(@.*)?$ -
^(obsolete)(@.*)?$ -
^(requested)(@.*)?$ -