#! /bin/sh # $AdminSVN: clusteradm/stuff/scrapeopts.sh 6037 2014-08-01 19:12:38Z peter $ # trivial script to compare the currently installed packages # relative to our best guess as to what the default values were. # This is intended to be a helper to compare a machine that's been # run by hand for a while with portmaster to how ports currently exists. # Some non-default settings will just be changed options that aren't # tracked by portmaster, others will be intentional. They should # all be explained (or dismissed if it's not important). hn="$(hostname | tr A-Z a-z | sed -e 's/\.freebsd\.org//')" pkg query "%o %Ok %Ov" | sort | while read origin key value do if [ ! -d /usr/ports/$origin ] ; then echo "$hn $origin MISSING /usr/ports/$origin" continue fi def=$(echo "DOCS NLS EXAMPLES IPV6"; make -C /usr/ports/$origin -V OPTIONS_DEFAULT) if [ "$value" == off ]; then for i in $def; do if [ "$i" == "$key" ]; then echo "$hn $origin $key was changed to off" break fi done fi if [ "$value" == on ]; then found=false for i in $def; do if [ "$i" == "$key" ]; then found=true fi done if ! $found ; then echo "$hn $origin $key was changed to on" fi fi done