updated on Thu Jan 12 04:00:44 UTC 2012
[aur-mirror.git] / maven2-opt / usemvn.sh
blobe951ade4cb04610024a7695efe125d7481412c39
1 # switch PATH to new M2_HOME
3 path_remove() {
4 # remove element from colon separated list
5 # usage: path_remove <pathvar> <pathelement>
6 eval path_removeP="\"\$$1\""
7 path_removeP=`(NP= S= IFS=: ; for P in $path_removeP; do [ "$P" = "$2" ] && continue; NP="$NP$S$P"; S=':'; done; echo "$NP")`
8 eval $1='"$path_removeP"'
9 eval [ "\"\$$1\"" ] || unset "$1"
12 export M2_HOME
14 path_remove PATH "/opt/maven/bin"
15 path_remove PATH "/opt/maven2/bin"
16 if [ "$M2_HOME" ]; then
17 path_remove PATH "$M2_HOME/bin"
18 export PATH=$M2_HOME/bin:$PATH
21 unset -f path_remove