Skip to content

Instantly share code, notes, and snippets.

@Wu-Wu
Last active December 16, 2015 02:19
Show Gist options
  • Save Wu-Wu/5361584 to your computer and use it in GitHub Desktop.
Save Wu-Wu/5361584 to your computer and use it in GitHub Desktop.
"required by/depends on" for each installed perl 5 package on FreeBSD
#!/bin/sh
PKGS=`pkg_info | grep ^p5- | awk '{print $1}'`
for pkg in $PKGS;
do
echo "Package ${pkg}"
echo "------------------------------------------------------"
echo "Required by:"
pkg_info -R $pkg | grep -v Information | grep -v Required | grep -v "^$"
echo "------------------------------------------------------"
echo "Depends on:"
pkg_info -r $pkg | grep -v Information | grep -v Depends | grep -v "^$" | awk '{print $2}'
echo "======================================================"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment