#!/bin/bash # Ranks developer ChangeLog comments in a category rank_category() { local PORTDIR if [ -z "${3}" ]; then PORTDIR="/usr/portage" else PORTDIR="${3}" fi if [ -z "${1}" ]; then echo "Usage: rank-category category (eg, x11-wm)" return 1 fi if [ -z "${2}" ] ; then egrep -oh '[a-z]{1,}@gentoo.org' ${PORTDIR}/${1}/*/ChangeLog | \ sort | uniq -c | sort -n else egrep -oh '[a-z]{1,}@gentoo.org' ${PORTDIR}/${1}/*/ChangeLog | \ sort | uniq -c | sort -n | tail -n ${2} fi } rank_category $@