If you don't want to check md5sums with equery check then this would work... ;)
# cd /var/db/pkg && for pkg in */*; do grep ^dir "$pkg"/CONTENTS | cut -d" " -f2 | \ while read dir; do if [[ ! -d "$dir" ]]; then echo Dir "$dir" is missing in "$pkg"; fi; done; grep ^obj "$pkg"/CONTENTS | cut -d" " -f2 | \ while read file; do if [[ ! -f "$file" ]]; then echo File "$file" is missing in "$pkg"; fi; done; grep ^sym "$pkg"/CONTENTS | cut -d" " -f2 | \ while read sym; do if [[ ! -L "$sym" ]]; then echo Symlink "$sym" is missing in "$pkg"; fi; done; done -- Bo Andresen
pgpo8PUpdOC9W.pgp
Description: PGP signature