diff rc/bashrc @ 440:abbdb936a36a

Automated pgsql yum version detect.
author Edho Arief <edho@myconan.net>
date Sun, 06 Jan 2013 13:52:11 +0300
parents cb2d444253f4
children c3bfb45757e9
line wrap: on
line diff
--- a/rc/bashrc	Sun Jan 06 13:28:24 2013 +0300
+++ b/rc/bashrc	Sun Jan 06 13:52:11 2013 +0300
@@ -29,9 +29,11 @@
 # OpenBSD X11
 test -d /usr/X11R6/bin && PATH="${PATH}:/usr/X11R6/bin"
 # PostgreSQL Yum
-test -d /usr/pgsql-8.4 && PATH="/usr/pgsql-8.4/bin:${PATH}"
-test -d /usr/pgsql-9.1 && PATH="/usr/pgsql-9.1/bin:${PATH}"
-test -d /usr/pgsql-9.2 && PATH="/usr/pgsql-9.2/bin:${PATH}"
+# Defaults to last version available.
+_pgbindir=(/usr/pgsql-*/bin)
+_pgbindir="${_pgbindir[@]:(-1)}"
+test -d "${_pgbindir}" && PATH="${_pgbindir}:${PATH}"
+unset _pgbindir
 
 # PostgreSQL EnterpriseDB
 # Defaults to last version available.