#!/bin/bash
export PORTDIR=/data/src/gentoo-x86
# guesses who is to blame for a given package. uses metadata.xml if it's
# available. if not, it will try to use cvs log to determine who commited the
# ebuilds (only if a cvs co is available, of course...)
ewho() {
local pc d metadata f
pc=$(efind $*)
d=$(eportdir)
f=0
if [[ $pc == "" ]] ; then
echo "nothing found for $*"
return 1
fi
metadata="${d}/${pc}/metadata.xml"
if [[ -f "${metadata}" ]] ; then
echo "metadata.xml says:"
sed -ne 's,^.*\([^<]*\).*, herd: \1,p' \
"${metadata}"
sed -ne 's,^.*\([^<]*\)@[^<]*.*, dev: \1,p' \
"${metadata}"
f=1
fi
if [[ -d ${d}/${pc}/CVS ]] ; then
echo "CVS log says:"
pushd ${d}/${pc} > /dev/null
for e in *.ebuild ; do
echo -n "${e}: "
cvs log ${e} | sed -e '1,/^revision 1\.1$/d' | sed -e '2,$d' \
-e "s-^.*author: --" -e 's-;.*--'
done
popd > /dev/null
f=1
fi
if [[ f == 0 ]] ; then
echo "Nothing found, so blame seemant"
return 1
fi
return 0
}
ewho $@