###
### AUTOGENERATED BY EUPS' configure script (via bin/mksetup)
###

setenv EUPS_SHELL csh

if ("$?EUPS_DIR" == "1" ) then
   setenv PATH `echo $PATH | perl -pe "s|:$EUPS_DIR/bin||g"`
   if ("$?PYTHONPATH" == "1" ) then
      setenv PYTHONPATH `echo $PYTHONPATH | perl -pe "s|:$EUPS_DIR/python||g"`
   endif
   setenv EUPS_DIR "${EUPS_DIR}"
else
   setenv EUPS_DIR "/opt/hscpipe/8.4/lsst_home/eups/2.1.5"
endif
set eupslocalpath = `echo "$EUPS_DIR" | sed -e "s/ /-+-/g"`

if ("$?EUPS_PATH" == "0" ) then
    setenv EUPS_PATH ""
endif

# Set EUPS_PATH, appending any pre-existing EUPS_PATH (and only keeping
# one copy of each directory)
setenv EUPS_PATH `python -E` << EOT

from __future__ import print_function
import sys
pp = []
for d in "$EUPS_PATH".split(":"):
    if d and d not in pp:
        pp += [d]
if not "/opt/hscpipe/8.4/lsst_home/stack/miniconda3-4.7.10-4d7b902" in pp:
    pp = ["/opt/hscpipe/8.4/lsst_home/stack/miniconda3-4.7.10-4d7b902"] + pp
print(":".join(pp))
EOT
set _eups_path = "$EUPS_PATH"

# csh shells die if variables are undefined, so we'll define an (empty) DYLD_LIBRARY_PATH
# if there isn't one already
if (! $?DYLD_LIBRARY_PATH) then
    setenv DYLD_LIBRARY_PATH ""
endif

# setup EUPS, using EUPS
# n.b.: we reset the flavor in SETUP_EUPS so eups doesn't show up in 'eups list'
#       and similar. This is for backwards compatibility.
eval `"$EUPS_DIR/bin/eups_setup" "DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}" eups -r "$EUPS_DIR"`
setenv SETUP_EUPS "eups LOCAL:$eupslocalpath -f (none) -Z (none)"
setenv EUPS_PATH "$_eups_path"            # make sure that the setup script didn't reset EUPS_PATH
unset eupslocalpath _eups_path


