#!/bin/bash -ue

source $OPENSHIFT_CARTRIDGE_SDK_BASH

cart_version=$1
curr=$2
next=$3

OSE_20_LATEST="0.0.10.1"
OSE_21_GA="0.3.13"

# The LD_LIBRARY_PATH is now handled by the Node itself
# and constructed using LD_LIBRARY_PATH_ELEMENT. This will
# remove the existing LD_LIBRARY_PATH so the Node one can
# take the precedence.
if version_lt $curr $OSE_21_GA; then
  if [ -f ${OPENSHIFT_POSTGRESQL_DIR}env/LD_LIBRARY_PATH ]; then
    rm -f ${OPENSHIFT_POSTGRESQL_DIR}env/LD_LIBRARY_PATH
  fi
fi
