--- postgresql.eselect.orig 2011-04-18 18:03:30 +0900 +++ postgresql.eselect 2011-04-21 21:25:01 +0900 @@ -81,8 +81,12 @@ ### Get Slots Function ### # Find all available slots in the preferred lib_dir() and return them. get_slots() { - echo $(find "${B_PATH}/$(lib_dir)" -maxdepth 1 -type d \ - -regex '.*postgresql-[0-9]+\.[0-9]+' -printf '%f\n' | \ + if [ "`uname`" == "FreeBSD" ] ; then + local findopt="-E" + fi + echo $(find $findopt "${B_PATH}/$(lib_dir)" -maxdepth 1 -type d \ + -regex '.*postgresql-[0-9]+\.[0-9]+' -print0 | \ + xargs -0 | gawk '{ print gensub(/(.*)\/(.*)/,"\\2","") }' | \ sed -re 's#^.+-##' | sort -n) }