All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
find_fhicl.sh
Go to the documentation of this file.
1 #!/bin/bash
2 
3 if [ x$FHICL_FILE_PATH = x ]; then
4  echo "***************************************"
5  echo "Variable FHICL_FILE_PATH not found."
6  echo "You porbably haven't set up larsoft yet,"
7  echo "Try 'setup uboonecode vXX_XX_XX -q e10:prof"
8  echo "OR 'mrbsetenv'"
9  echo "***************************************"
10  exit 1
11 
12 fi
13 
14 FHICL_SEARCH_FILE=$1
15 
16 if [ x$FHICL_SEARCH_FILE = x ]; then
17  echo "***************************************"
18  echo "USAGE: find_fhicl <fhicl file name>."
19  echo "Note that \$FHICL_FILE_PATH must be defined."
20  echo "Try 'setup uboonecode vXX_XX_XX -q e10:prof"
21  echo "OR 'mrbsetenv' if it isn't"
22  echo "***************************************"
23  exit 1
24 
25 
26 fi
27 
28 SEARCH_PATHS=(`awk '{split($0,array,":"); for (a in array) printf "%s ", array[a]; printf "\n";}' <<< $FHICL_FILE_PATH`)
29 
30 if [ ! -d "srcs" ]; then
31  echo "***************************************"
32  echo "NOTE: I do not see a 'srcs' directory in $PWD"
33  echo "I will continue to search \$FHICL_FILE_PATH,"
34  echo "but you will unlikely have write access to the file."
35  echo "Check out a version of uboonecode using the instructions"
36  echo "Provided here: "
37  echo "https://cdcvs.fnal.gov/redmine/projects/uboonecode/wiki/Uboone_guide"
38  echo "***************************************"
39 
40 
41 
42 #if srcs directory exists, add it to the search path
43 else
44  SEARCH_PATHS=("${SEARCH_PATHS[@]}" "srcs")
45 fi
46 
47 
48 for elt in ${SEARCH_PATHS[*]};
49 do
50 
51  #skip local dirs autmoatically added to the path but do not exist
52  #echo $CHECKED_WORKING_DIR
53  if [ ! -d "$elt" ]; then
54  continue
55  fi
56 
57  # also, skip the current working dir (".")
58  if [ "$elt" == "." ]; then
59  continue
60  fi
61 
62 
63  #echo $elt
64  FOUND_FHICL=`find $elt -name $FHICL_SEARCH_FILE`
65 
66  if [ -n "$FOUND_FHICL" ]; then
67  echo "=========================="
68  echo "Found fhicl file(s):"
69 
70  awk -F:" " '{printf "%s \n", $1}' <<< $FOUND_FHICL
71  fi
72 
73 done
process_name opflash particleana ie x
then shift fi
if &&[-z"$BASH_VERSION"] then echo Attempting to switch to bash bash shellSwitch exit fi &&["$1"= 'shellSwitch'] shift declare a IncludeDirectives for Dir in
then echo fcl name