#! /bin/sh # $AdminSVN: clusteradm/stuff/compareopts.sh 6038 2014-08-01 19:14:18Z peter $ # Simple script that compares the options of the current installed packages # to how they were last built with portmaster. It is intended to be used # as a sanity check after converting a portmaster machine to a pkg machine # and making sure that the differences are intended/acceptable. hn="$(hostname | tr A-Z a-z | sed -e 's/\.freebsd\.org//')" pkg query "%o %Ok %Ov" | sort | while read origin key value do sane=$(echo $origin | sed -e 's@/@_@') if [ ! -f /var/db/ports/$sane/options ] ; then #echo "$hn $origin had no port options" continue fi #OPTIONS_FILE_SET+=EXAMPLES #OPTIONS_FILE_UNSET+=LIBEVENT2 if [ "$value" == off ]; then if grep -s "^OPTIONS_FILE_SET+=$key\$" /var/db/ports/$sane/options >/dev/null 2>&1 ; then echo "$hn $origin $key on->off" fi fi if [ "$value" == on ]; then if grep -s "^OPTIONS_FILE_UNSET+=$key\$" /var/db/ports/$sane/options >/dev/null 2>&1 ; then echo "$hn $origin $key off->on" fi fi done