--- gentoo.orig 2007-06-08 15:58:54.000000000 -0700 +++ gentoo.new 2007-06-08 16:06:39.000000000 -0700 @@ -20,13 +20,12 @@ # _portdir() { - sed -n -e '/^PORTDIR=/ { s/^[^=]\+="\?\([^"]\+\|\S\+\).*/\1/p ; q }' \ - /etc/make.{conf,globals} 2>/dev/null - - if [[ $1 == '-o' ]] ; then - sed -n -e '/^PORTDIR_OVERLAY=/ { s/^[^=]\+="\?\([^"]\+\|\S\+\).*/\1/p ; q }' \ - /etc/make.conf 2>/dev/null - fi + local grab='${PORTDIR}' + [[ $1 == '-o' ]] && grab="${grab} \${PORTDIR_OVERLAY}" + # use the source, Luke -- offers flexibility in make.conf + eval "source /etc/make.globals + source /etc/make.conf + echo ${grab}" } # like _pkgname but completes on package names only (no category)