#!/bin/bash # 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}/src/gentoo-x86 ]] ; then eval "eportdir() { echo ${HOME}/src/gentoo-x86 ; }" eportdir $* elif [[ -d /usr/local/share/gentoo-x86 ]] ; then eval "eportdir() { echo /usr/local/share/gentoo-x86 ; }" eportdir $* else eval "eportdir() { echo `portageq portdir` ; }" eportdir $* fi } eportdir $@