changeset 264:c6c322c57e0e

Paths for MySQL, instabreak for mercurial.
author Edho Arief <edho@myconan.net>
date Thu, 24 Nov 2011 12:24:05 +0700
parents 640836861a75
children 20ff9a9d11f0 69b9cbf9f3c0
files rc/bash
diffstat 1 files changed, 15 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/rc/bash	Thu Nov 24 12:16:27 2011 +0700
+++ b/rc/bash	Thu Nov 24 12:24:05 2011 +0700
@@ -105,9 +105,23 @@
   [ -d "${i}" ] && PATH="${i}:${PATH}"
 done
 
+# MySQL in common locations highest priority since new = better. Also no compatibility problem.
+# Cluster is superset of Enterprise/GPL so it gets highest priority.
+# And use only one.
+for mydir in {"${HOME}",/app{,s},/opt}/mysql/{{cluster,enterprise}/mysql/,}bin; do
+  if [ -d "${mydir}" ]; then
+    PATH="${mydir}:${PATH}"
+    break
+  fi
+done
+
 # Mercurial is optional since it will be inconsistent with ssh ... hg if this one gets priority.
+# And use only one.
 for hgdir in {"${HOME}/app","/opt"}/mercurial; do
-  [ -x "${hgdir}/hg" ] && PATH="${PATH}:${hgdir}"
+  if [ -x "${hgdir}/hg" ]; then
+    PATH="${PATH}:${hgdir}"
+    break
+  fi
 done
 
 case "${TERM}" in