Changeset 3925
- Timestamp:
- 2013-06-15T09:45:59+02:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NEMOGCM/TOOLS/COMPILE/Fcheck_archfile.sh
r3922 r3925 75 75 } 76 76 # cleaning related to the old version 77 myarch=$( find ${MAIN_DIR}/ARCH -type l -name arch-${3}.fcm -print ) 78 [ ${#myarch} -ne 0 ] && rm -f $myarch 77 rm -f $( find ${COMPIL_DIR} -type l -name $1 -print ) 79 78 # 80 79 if [ ${#3} -eq 0 ]; then # arch not specified … … 95 94 else 96 95 if [ -f ${COMPIL_DIR}/$1 ]; then 96 # has the cpp keys file been changed since we copied the arch file in ${COMPIL_DIR}? 97 mycpp=$( ls -l ${COMPIL_DIR}/$2 | sed -e "s/.* -> //" ) 98 if [ "$mycpp" != "$( cat ${COMPIL_DIR}/cpp.history )" ]; then 99 echo $mycpp > ${COMPIL_DIR}/cpp.history 100 cpeval ${myarch} ${COMPIL_DIR}/$1 101 fi 102 # has the cpp keys file been updated since we copied the arch file in ${COMPIL_DIR}? 103 mycpp=$( find -L ${COMPIL_DIR} -cnewer ${COMPIL_DIR}/$1 -name $2 -print ) 104 [ ${#mycpp} -ne 0 ] && cpeval ${myarch} ${COMPIL_DIR}/$1 105 # has myarch file been updated since we copied it in ${COMPIL_DIR}? 97 106 myarchdir=$( dirname ${myarch} ) 98 107 myarchname=$( basename ${myarch} ) 99 # have the cpp keys been updated since we copy the arch file in ${COMPIL_DIR}?100 mycpp=$( find -L ${COMPIL_DIR} -cnewer ${COMPIL_DIR}/$1 -name $2 -print )101 [ ${#mycpp} -ne 0 ] && cpeval ${myarch} ${COMPIL_DIR}/$1102 # has myarch been updated since we copy it in ${COMPIL_DIR}?103 108 myarch=$( find -L $myarchdir -cnewer ${COMPIL_DIR}/$1 -name $myarchname -print ) 104 109 [ ${#myarch} -ne 0 ] && cpeval ${myarch} ${COMPIL_DIR}/$1 … … 109 114 fi 110 115 else 111 myarch=$( find ${MAIN_DIR}/ARCH -name arch-${3}.fcm -print ) 112 if [ ${#myarch} -gt 0 ]; then # the arch file specified by the use exists 113 # we were already using this arch file 114 if [ "$myarch" == "$( cat ${COMPIL_DIR}/arch.history )" ]; then 115 if [ -f ${COMPIL_DIR}/$1 ]; then 116 # have the cpp keys been updated since we copy the arch file in ${COMPIL_DIR}? 117 mycpp=$( find -L ${COMPIL_DIR} -cnewer ${COMPIL_DIR}/$1 -name $2 -print ) 118 [ ${#mycpp} -ne 0 ] && cpeval ${myarch} ${COMPIL_DIR}/$1 119 # has myarch been updated since we copy it in ${COMPIL_DIR}? 120 myarch=$( find -L ${MAIN_DIR}/ARCH -cnewer ${COMPIL_DIR}/$1 -name arch-${3}.fcm -print ) 121 [ ${#myarch} -ne 0 ] && cpeval ${myarch} ${COMPIL_DIR}/$1 122 else 123 cpeval ${myarch} ${COMPIL_DIR}/$1 124 fi 125 else 126 echo ${myarch} > ${COMPIL_DIR}/arch.history 127 cpeval ${myarch} ${COMPIL_DIR}/$1 128 fi 129 else 116 nb=$( find ${MAIN_DIR}/ARCH -name arch-${3}.fcm -print | wc -l ) 117 if [ $nb -eq 0 ]; then # no arch file found 130 118 echo "Warning !!!" 131 119 echo "Compiler not existing" … … 133 121 echo "EXITING..." 134 122 exit 1 135 fi 123 fi 124 if [ $nb -gt 1 ]; then # more than 1 arch file found 125 echo "Warning !!!" 126 echo "more than 1 arch file for the same compiler have been found" 127 find ${MAIN_DIR}/ARCH -name arch-${3}.fcm -print 128 echo "keep only 1" 129 echo "EXITING..." 130 exit 1 131 fi 132 myarch=$( find ${MAIN_DIR}/ARCH -name arch-${3}.fcm -print ) 133 # we were already using this arch file ? 134 if [ "$myarch" == "$( cat ${COMPIL_DIR}/arch.history )" ]; then 135 if [ -f ${COMPIL_DIR}/$1 ]; then 136 # has the cpp keys file been changed since we copied the arch file in ${COMPIL_DIR}? 137 mycpp=$( ls -l ${COMPIL_DIR}/$2 | sed -e "s/.* -> //" ) 138 if [ "$mycpp" != "$( cat ${COMPIL_DIR}/cpp.history )" ]; then 139 echo $mycpp > ${COMPIL_DIR}/cpp.history 140 cpeval ${myarch} ${COMPIL_DIR}/$1 141 fi 142 # has the cpp keys file been updated since we copied the arch file in ${COMPIL_DIR}? 143 mycpp=$( find -L ${COMPIL_DIR} -cnewer ${COMPIL_DIR}/$1 -name $2 -print ) 144 [ ${#mycpp} -ne 0 ] && cpeval ${myarch} ${COMPIL_DIR}/$1 145 # has myarch file been updated since we copied it in ${COMPIL_DIR}? 146 myarch=$( find -L ${MAIN_DIR}/ARCH -cnewer ${COMPIL_DIR}/$1 -name arch-${3}.fcm -print ) 147 [ ${#myarch} -ne 0 ] && cpeval ${myarch} ${COMPIL_DIR}/$1 148 else 149 cpeval ${myarch} ${COMPIL_DIR}/$1 150 fi 151 else 152 ls -l ${COMPIL_DIR}/$2 | sed -e "s/.* -> //" > ${COMPIL_DIR}/cpp.history 153 echo ${myarch} > ${COMPIL_DIR}/arch.history 154 cpeval ${myarch} ${COMPIL_DIR}/$1 155 fi 136 156 fi 137 157
Note: See TracChangeset
for help on using the changeset viewer.