#! /bin/sh # $AdminSVN: clusteradm/pkgleaves.sh 6459 2014-09-20 19:48:16Z peter $ # # Trivial script to identify leaf packages # # It checks the explicitly installed ones with dependencies in case # it is fallout from a previous 'portmaster -fa' run (which clears # the autoremove flag), or the bug in pkg-1.3 that sometimes forgets # the autoremove flag. # hn="$(hostname | tr A-Z a-z | sed -e 's/\.freebsd\.org//')" pkg query "%o %a %#r" | sort | while read origin auto depcnt do if [ "$auto" = 0 ]; then if [ "$depcnt" = 0 ]; then echo "$hn $origin" else echo "$hn $origin (warning: has $depcnt consumers, possibly not leaf)" fi fi done