-alias pbuild="sudo pkg install --automatic \`make build-depends-list | sed 's/\/usr\/ports\// /' | tr -d '\n'\`"
-alias prun="sudo pkg install --automatic \`make run-depends-list | sed 's/\/usr\/ports\// /' | tr -d '\n'\`"
+function portpkg {
+ case "$1" {
+ build|run) ;;
+ *)
+ echo "Usage: \`portpkg <build|run>' in a port directory"
+ return 1;;
+ }
+ sudo pkg install -AU $(make ${1}-depends-list | sed 's_/usr/ports/_ _' | tr -d '\n')
+}