#!/bin/bash  #-- not used anyhow
#
# $Id: file2,v 1.1.1.1 2000/09/15 02:19:36 blais Exp $
#

# echo "Bashrc executed"

export SHELL=bash


# Reset environment in bash if requested.  The reason why we do this is for
# setting stuff that depends on the calling process environment, e.g. with
# ClearCase.

if [ -f "$HOME/.cache.bashenv" ]; then
    # echo "Resetting environment in .bashrc"
    . $HOME/conf/.env.pre
    . $HOME/conf/.env.scopes
    . $HOME/conf/.env.post
fi

# check for cache first
if [ ! -f "$HOME/.cache.disable" -a \
     -f "$HOME/.cache.bashrc.$SITE.$PLAT.$HOST" ]; then

    echo "Using cached .bashrc";
    . $HOME/.cache.bashrc.$SITE.$PLAT.$HOST

else

    #---------------------------------------------------------------------------
    # source scope-specific bashrc's
    
    if [ -f $HOME/conf/share/.bashrc.local ]; then
    	. $HOME/conf/share/.bashrc.local
    fi
    
    if [ -f $HOME/conf/site/$SITE/.bashrc.local ]; then
    	. $HOME/conf/site/$SITE/.bashrc.local
    fi
    
    if [ -f $HOME/conf/plat/$PLAT/.bashrc.local ]; then
    	. $HOME/conf/plat/$PLAT/.bashrc.local
    fi
    
    if [ -f $HOME/conf/host/$HOST/.bashrc.local ]; then
    	. $HOME/conf/host/$HOST/.bashrc.local
    fi
    
    if [ -f $HOME/conf/site/$SITE/plat/$PLAT/.bashrc.local ]; then
    	. $HOME/conf/site/$SITE/plat/$PLAT/.bashrc.local
    fi
    
    if [ -f $HOME/conf/host/$HOST/plat/$PLAT/.bashrc.local ]; then
    	. $HOME/conf/host/$HOST/plat/$PLAT/.bashrc.local
    fi
fi
