--- /usr/share/bash-completion/gentoo.old 2005-07-26 17:58:30.000000000 +0200 +++ /usr/share/bash-completion/gentoo 2005-07-28 14:11:23.000000000 +0200 @@ -20,13 +20,15 @@ # _portdir() { - sed -n -e '/^PORTDIR=/ { s/^[^=]\+="\?\([^"]\+\|\S\+\).*/\1/p ; q }' \ - /etc/make.{conf,globals} 2>/dev/null + ( + source /etc/make.conf - if [[ $1 == '-o' ]] ; then - sed -n -e '/^PORTDIR_OVERLAY=/ { s/^[^=]\+="\?\([^"]\+\|\S\+\).*/\1/p ; q }' \ - /etc/make.conf 2>/dev/null - fi + if [[ $1 == '-o' ]] ; then + echo ${PORTDIR_OVERLAY} + else + echo ${PORTDIR} + fi + ) } # like _pkgname but completes on package names only (no category)