diff options
author | Markus Ullmann <jokey@gentoo.org> | 2006-11-01 11:46:19 +0000 |
---|---|---|
committer | Markus Ullmann <jokey@gentoo.org> | 2006-11-01 11:46:19 +0000 |
commit | dde1c721065d7ea1d28f2001d56e54610672c656 (patch) | |
tree | dbf846cfa392cc031a9ab024982b2081f5652f2a /scripts/deprecated-vlibpcap-maintainers.sh | |
parent | scripts are always needed (diff) | |
download | jokey-dde1c721065d7ea1d28f2001d56e54610672c656.tar.gz jokey-dde1c721065d7ea1d28f2001d56e54610672c656.tar.bz2 jokey-dde1c721065d7ea1d28f2001d56e54610672c656.zip |
more scripts
svn path=/trunk/; revision=68
Diffstat (limited to 'scripts/deprecated-vlibpcap-maintainers.sh')
-rwxr-xr-x | scripts/deprecated-vlibpcap-maintainers.sh | 107 |
1 files changed, 107 insertions, 0 deletions
diff --git a/scripts/deprecated-vlibpcap-maintainers.sh b/scripts/deprecated-vlibpcap-maintainers.sh new file mode 100755 index 0000000..21c6c18 --- /dev/null +++ b/scripts/deprecated-vlibpcap-maintainers.sh @@ -0,0 +1,107 @@ +#!/bin/bash +PLIST=`cat deprecated-vlibpcap-20061202.txt` + +CVSDIR=${HOME}/cvs +# find either a cvs co of gentoo's portage module or the portage directory, and +# echo the result. +eportdir() +{ + # does fast cache magic. portageq in particular is really slow... this makes + # subsequent calls to eportdir() pretty much instantaneous, as opposed to + # taking several seconds. + if [[ -d ${HOME}/gentoo-x86 ]] ; then + eval "eportdir() { echo ${HOME}/gentoo-x86 ; }" + eportdir $* + elif [[ -d ${CVSDIR}/gentoo-x86 ]] ; then + eval "eportdir() { echo ${HOME}/cvs/gentoo-x86 ; }" + eportdir $* + else + eval "eportdir() { echo `portageq portdir` ; }" + eportdir $* + fi +} + +# find a given ebuild. based upon code by agriffis. does some fancy prediction, +# so it will find categories if necessary (eg efind sparc-dev-sources will find +# sys-kernel/sparc-dev-sources, and does partial name matching). prints the +# result in the form category/package . +efind() +{ + local efinddir cat pkg + efinddir=$(eportdir) + + case $1 in + *-*/*) + pkg=${1##*/} + cat=${1%/*} + ;; + + ?*) + pkg=${1} + cat=$(echo1 ${efinddir}/*-*/${pkg}/*.ebuild) + [[ -f $cat ]] || cat=$(echo1 ${efinddir}/*-*/${pkg}*/*.ebuild) + [[ -f $cat ]] || cat=$(echo1 ${efinddir}/*-*/*${pkg}/*.ebuild) + [[ -f $cat ]] || cat=$(echo1 ${efinddir}/*-*/*${pkg}*/*.ebuild) + [[ -f $cat ]] || return 1 + pkg=${cat%/*} + pkg=${pkg##*/} + cat=${cat#${efinddir}/} + cat=${cat%%/*} + ;; + esac + + echo ${cat}/${pkg} +} + +# 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 [[ -z "$pc" ]] ; then + echo "nothing found for $*" + return 1 + fi + + echo -e "${pc}:" + metadata="${d}/${pc}/metadata.xml" + if [[ -f "${metadata}" ]] ; then + sed -ne 's,^.*<herd>\([^<]*\)</herd>.*, herd: \1,p' \ + "${metadata}" + sed -ne 's,^.*<email>\([^<]*\)@[^<]*</email>.*, dev: \1,p' \ + "${metadata}" + f=1 + + elif [[ -d ${d}/${pc}/CVS ]] ; then + if [[ ${RUNLEVEL} != "work" ]] ; then + 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 + else + echo "Cannot access cvs.gentoo.org!" + fi + fi + + if [[ $f -eq 0 ]] ; then + echo "Nothing found, so blame ciaranm (who blames seemant)" + return 1 + fi + + return 0 +} + +for i in `echo ${PLIST}` + do + ewho ${i} +done |