I use portupgrade and pkg_cutleaves (carefully used)
When removing packages, I am not using pkg_delete or pkg_deinstall with the -r/-R options because they caused me enough times troubles but the below script , which backups the package and display the left dependencies ( I have call it pkg_remove
)
Code:
#!/bin/sh
before="/tmp/pkg_remove_before.tmp"
after="/tmp/pkg_remove_after.tmp"
pkg_cutleaves -l > $before
pkg_create -b $1
pkg_delete $1
pkg_cutleaves -l > $after
diff $before $after | awk '
BEGIN { print "####################################################"}
/\</ {print "Unistalled: "$2}
/\>/ {print "Remaining: "$2}
END { print "####################################################"}
'