Changeset 175


Ignore:
Timestamp:
04/06/12 13:22:38 (12 years ago)
Author:
pinsard
Message:

improve env. setting

File:
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/project_profile.sh

    • Property svn:keywords set to Id URL
    r157 r175  
    22#+ 
    33# 
    4 # .. program:: superbib_profile.sh 
     4# .. program:: project_profile.sh 
    55# 
    66# =================== 
    7 # superbib_profile.sh 
     7# project_profile.sh 
    88# =================== 
    99# 
    10 # --------------------------- 
    11 # define SUPERBIB environment 
    12 # --------------------------- 
    1310# 
    1411# SYNOPSIS 
     
    1714# Online usage :: 
    1815# 
    19 #  $ . ./superbib_profile.sh -d directory -i indir -o outdir -t tempdir 
     16#  $ . ./project_profile.sh -d directory -i indir -o outdir -t tempdir 
    2017# 
    2118# In :file:`${HOME}/.profile`, add the following line :: 
    2219# 
    23 #  . superbib_profile.sh -d directory  -i indir -o outdir -t tempdir 
     20#  . project_profile.sh -d directory  -i indir -o outdir -t tempdir 
    2421# 
    2522# DESCRIPTION 
     
    3330# define SUPERBIB environment 
    3431# 
    35 # ${SUPERBIB} is the base directory of tools. 
    36 # 
    37 # ${SUPERBIB_LOG} is the directory where log files  will be written. 
    38 # 
    39 # ${SUPERBIB_ID} is the directory where input files must be. 
    40 # 
    41 # ${SUPERBIB_OD}  is the directory where output files will be written. 
     32# ${PROJECT} is the base directory of tools. 
     33# 
     34# ${PROJECT_LOG} is the directory where log files  will be written. 
     35# 
     36# ${PROJECT_ID} is the directory where input files must be. 
     37# 
     38# ${PROJECT_OD}  is the directory where output files will be written. 
    4239# 
    4340# MANPATH++ 
     
    4946# 
    5047#  $ cd /usr/home/fplod/src/superbib/superbib_ws/ 
    51 #  $ . ./src/superbib_profile.sh \ 
     48#  $ . ./src/project_profile.sh \ 
    5249#    -d $(pwd) \ 
    5350#    -i /usr/temp/${LOGNAME}/superbib_d/ \ 
     
    7067# 
    7168# $Id$ 
     69# 
     70# $URL$ 
     71# 
     72# - fplod 20120405T085555Z cratos (Linux) 
     73# 
     74#   * rename and replace SUPERBIB by PROJECT 
    7275# 
    7376# - fplod 20100426T094821Z aedon.locean-ipsl.upmc.fr (Darwin) 
     
    98101# 
    99102# as this script might be launch in .profile, command is forced. 
    100 command=superbib_profile.sh 
     103command=project_profile.sh 
    101104# 
    102105usage=" Usage : ${command} -d directory -i indir -o outdir -t tempdir" 
     
    151154fi 
    152155# 
    153 SUPERBIB=${directory} 
    154 export SUPERBIB 
    155 # 
    156 # add SUPERBIB tools to PATH 
     156PROJECT=${directory} 
     157export PROJECT 
     158# 
     159# add PROJECT tools to PATH 
    157160# if not already done 
    158 suppath=$(echo ${SUPERBIB} | tr -s "/") 
     161suppath=$(echo ${PROJECT} | tr -s "/") 
    159162echo ${PATH} | grep -q "${suppath}:" 
    160163test_path=${?} 
     
    170173unset suppath 
    171174# 
    172 # add SUPERBIB manuals to MANPATH 
     175# add PROJECT manuals to MANPATH 
    173176# if not already done 
    174 suppath=$(echo ${SUPERBIB}/doc/manuals/man | tr -s "/") 
     177suppath=$(echo ${PROJECT}/doc/manuals/man | tr -s "/") 
    175178echo ${MANPATH} | grep -q "${suppath}:" 
    176179test_manpath=${?} 
     
    186189unset suppath 
    187190# 
    188 SUPERBIB_LOG=${tempdir} 
    189 export SUPERBIB_LOG 
     191PROJECT_LOG=${tempdir} 
     192export PROJECT_LOG 
    190193unset tempdir 
    191 if [ ! -d ${SUPERBIB_LOG} ] 
    192 then 
    193    mkdir -p ${SUPERBIB_LOG} 
     194if [ ! -d ${PROJECT_LOG} ] 
     195then 
     196   mkdir -p ${PROJECT_LOG} 
    194197   status=${?} 
    195198   if [ ${status} -ne 0 ] 
    196199   then 
    197       echo "${command} : eee : can not create \${SUPERBIB_LOG}" 
     200      echo "${command} : eee : can not create \${PROJECT_LOG}" 
    198201      # nb : no exit because this file should be launched by login process 
    199202   else 
    200       echo "${command} : iii : creation of \${SUPERBIB_LOG}" 
     203      echo "${command} : iii : creation of \${PROJECT_LOG}" 
    201204   fi 
    202205   unset status 
    203206fi 
    204 # check for permission on SUPERBIB_LOG 
    205 if [ ! -x ${SUPERBIB_LOG} ] 
    206 then 
    207    echo " eee : ${SUPERBIB_LOG} not reachable" 
    208    # nb : no exit because this file should be launched by login process 
    209 fi 
    210 # 
    211 # check for permission on SUPERBIB_LOG 
    212 if [ ! -w ${SUPERBIB_LOG} ] 
    213 then 
    214    echo " eee : ${SUPERBIB_LOG} not writable" 
     207# check for permission on PROJECT_LOG 
     208if [ ! -x ${PROJECT_LOG} ] 
     209then 
     210   echo " eee : ${PROJECT_LOG} not reachable" 
     211   # nb : no exit because this file should be launched by login process 
     212fi 
     213# 
     214# check for permission on PROJECT_LOG 
     215if [ ! -w ${PROJECT_LOG} ] 
     216then 
     217   echo " eee : ${PROJECT_LOG} not writable" 
    215218   # nb : no exit because this file shouldreachable be launched by login process 
    216219fi 
     
    220223# 
    221224# io directories 
    222 SUPERBIB_ID=${indir} 
    223 export SUPERBIB_ID 
     225PROJECT_ID=${indir} 
     226export PROJECT_ID 
    224227unset indir 
    225 if [ ! -d ${SUPERBIB_ID} ] 
    226 then 
    227    mkdir -p ${SUPERBIB_ID} 
    228    echo "${command} : iii : creation of \${SUPERBIB_ID}" 
    229 fi 
    230 # check for permission on SUPERBIB_ID 
    231 if [ ! -x ${SUPERBIB_ID} ] 
    232 then 
    233    echo " eee : ${SUPERBIB_ID} not reachable" 
    234    # nb : no exit because this file should be launched by login process 
    235 fi 
    236 # 
    237 SUPERBIB_OD=${outdir} 
    238 export SUPERBIB_OD 
     228if [ ! -d ${PROJECT_ID} ] 
     229then 
     230   mkdir -p ${PROJECT_ID} 
     231   echo "${command} : iii : creation of \${PROJECT_ID}" 
     232fi 
     233# check for permission on PROJECT_ID 
     234if [ ! -x ${PROJECT_ID} ] 
     235then 
     236   echo " eee : ${PROJECT_ID} not reachable" 
     237   # nb : no exit because this file should be launched by login process 
     238fi 
     239# 
     240PROJECT_OD=${outdir} 
     241export PROJECT_OD 
    239242unset outdir 
    240 if [ ! -d ${SUPERBIB_OD} ] 
    241 then 
    242     mkdir -p ${SUPERBIB_OD} 
    243     echo "${command} : iii : creation of \${SUPERBIB_OD}" 
    244 fi 
    245 # check for permission on SUPERBIB_OD 
    246 if [ ! -x ${SUPERBIB_OD} ] 
    247 then 
    248    echo " eee : ${SUPERBIB_OD} not reachable" 
    249    # nb : no exit because this file should be launched by login process 
    250 fi 
    251 if [ ! -w ${SUPERBIB_OD} ] 
    252 then 
    253    echo " eee : ${SUPERBIB_OD} not writable" 
     243if [ ! -d ${PROJECT_OD} ] 
     244then 
     245    mkdir -p ${PROJECT_OD} 
     246    echo "${command} : iii : creation of \${PROJECT_OD}" 
     247fi 
     248# check for permission on PROJECT_OD 
     249if [ ! -x ${PROJECT_OD} ] 
     250then 
     251   echo " eee : ${PROJECT_OD} not reachable" 
     252   # nb : no exit because this file should be launched by login process 
     253fi 
     254if [ ! -w ${PROJECT_OD} ] 
     255then 
     256   echo " eee : ${PROJECT_OD} not writable" 
    254257   # nb : no exit because this file should be launched by login process 
    255258fi 
Note: See TracChangeset for help on using the changeset viewer.