Changeset 1623 for modipsl/trunk/util/script_diff_model
- Timestamp:
- 12/17/11 00:07:13 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
modipsl/trunk/util/script_diff_model
r1617 r1623 39 39 40 40 41 case $( hostname -s ) in 42 vargas*) 43 # alias ls=/opt/freeware/bin/ls 44 # alias wc=/opt/freeware/bin/wc 45 # alias tail=/opt/freeware/bin/tail 46 # alias tee=/opt/freeware/bin/tee 47 # module load svn 48 return 1 49 ;; 50 esac 51 41 52 # env must know MODIPSL path variable ! 42 53 MODIPSL=${MODIPSL:=$(pwd)} 54 tmpMODIPSL=${MODIPSL}/tmp 55 43 56 SUBMIT_DIR=$1 44 57 … … 68 81 MODIPSL_SAVE_NAME=modipsl_save_diff_$( date +%F_%H%M%S ) 69 82 echo "SAVE directory in " ${MODIPSL_SAVE_NAME} 70 MODIPSL_SAVE=${ MODIPSL}/tmp/${MODIPSL_SAVE_NAME}83 MODIPSL_SAVE=${tmpMODIPSL}/${MODIPSL_SAVE_NAME} 71 84 printDebugArray MODIPSL_SAVE 72 85 73 86 set +A ListRep -- $( find ${MODIPSL} -mindepth 1 -type d \ 74 \( -not -path '*.svn*' -a -not -path '*CVS*' -a -not -path "${MODIPSL} /modipsl_save*" \87 \( -not -path '*.svn*' -a -not -path '*CVS*' -a -not -path "${MODIPSL}" \ 75 88 -a -not -path "${MODIPSL}/bin" -a -not -path "${MODIPSL}/lib" -a -not -path "${MODIPSL}/util" \ 76 -a -not -path "${ MODIPSL}/tmp*" \) \89 -a -not -path "${tmpMODIPSL}*" \) \ 77 90 -exec bash -c " echo "'{}'" | sed -e 's&"${MODIPSL}"/&&' | tee -a >( sed -e 's&\(.*\)&"${MODIPSL_SAVE}"/\1&' | xargs mkdir -p >> out_mkdir 2>&1 ) " \; ) 78 91 rm out_mkdir … … 181 194 ListPathBranch[$i]=${comp} 182 195 183 svn diff -r ${ListPathRev[$i]} ${filecomp} > ${ MODIPSL}/svn_diff_${save_diff_file}196 svn diff -r ${ListPathRev[$i]} ${filecomp} > ${tmpMODIPSL}/svn_diff_${save_diff_file} 184 197 RET=$? 185 198 if [ $RET -gt 0 ] ; then … … 189 202 ListPathBranch[$i]="error" 190 203 else 191 svn status ${filecomp} > ${ MODIPSL}/svn_status_${save_diff_file}192 set -A NewFiles -- $( grep "^? *\(.*\.${SUFFIXES}\|AA_.*\|BB_.*\)$" ${ MODIPSL}/svn_status_${save_diff_file} | sed -e "s&? *&&" )204 svn status ${filecomp} > ${tmpMODIPSL}/svn_status_${save_diff_file} 205 set -A NewFiles -- $( grep "^? *\(.*\.${SUFFIXES}\|AA_.*\|BB_.*\)$" ${tmpMODIPSL}/svn_status_${save_diff_file} | sed -e "s&? *&&" ) 193 206 printDebugArray NewFiles 194 207 for file in ${NewFiles[@]} ; do … … 199 212 done 200 213 201 set -A ModifiedFiles -- $( grep "^M *" ${ MODIPSL}/svn_status_${save_diff_file} | sed -e "s&M *&&" )214 set -A ModifiedFiles -- $( grep "^M *" ${tmpMODIPSL}/svn_status_${save_diff_file} | sed -e "s&M *&&" ) 202 215 printDebugArray ModifiedFiles 203 216 for file in ${ModifiedFiles[@]} ; do … … 211 224 212 225 if ( ${DEBUG_mode} ); then 213 cp ${ MODIPSL}/svn_diff_${save_diff_file} ${SpathComp}/svn_diff226 cp ${tmpMODIPSL}/svn_diff_${save_diff_file} ${SpathComp}/svn_diff 214 227 else 215 rm ${ MODIPSL}/svn_status_${save_diff_file}216 mv ${ MODIPSL}/svn_diff_${save_diff_file} ${SpathComp}/svn_diff228 rm ${tmpMODIPSL}/svn_status_${save_diff_file} 229 mv ${tmpMODIPSL}/svn_diff_${save_diff_file} ${SpathComp}/svn_diff 217 230 fi 218 231 RET=$? … … 230 243 ListPathBranch[$i]=${tag} 231 244 232 cvs diff -U 2 ${filecomp} > ${ MODIPSL}/cvs_diff_${save_diff_file}_00233 #eval cvs diff -U 2 -r "${ListPathRev[$i]}" ${filecomp} > ${ MODIPSL}/cvs_diff_${save_diff_file}_00245 cvs diff -U 2 ${filecomp} > ${tmpMODIPSL}/cvs_diff_${save_diff_file}_00 246 #eval cvs diff -U 2 -r "${ListPathRev[$i]}" ${filecomp} > ${tmpMODIPSL}/cvs_diff_${save_diff_file}_00 234 247 RET=$? 235 248 if [ $RET -gt 1 ] ; then … … 239 252 ListPathBranch[$i]="error" 240 253 else 241 set -A NewFiles -- $( grep "^? .*\.${SUFFIXES}$" ${ MODIPSL}/cvs_diff_${save_diff_file}_00 | sed -e "s&? *&&" )254 set -A NewFiles -- $( grep "^? .*\.${SUFFIXES}$" ${tmpMODIPSL}/cvs_diff_${save_diff_file}_00 | sed -e "s&? *&&" ) 242 255 printDebugArray NewFiles 243 256 for file in ${NewFiles[@]} ; do … … 248 261 done 249 262 250 set -A ModifiedFiles -- $( grep "^M .*\.${SUFFIXES}$" ${ MODIPSL}/cvs_diff_${save_diff_file}_00 | sed -e "s&M *&&" )263 set -A ModifiedFiles -- $( grep "^M .*\.${SUFFIXES}$" ${tmpMODIPSL}/cvs_diff_${save_diff_file}_00 | sed -e "s&M *&&" ) 251 264 printDebugArray ModifiedFiles 252 265 for file in ${ModifiedFiles[@]} ; do … … 259 272 done 260 273 261 ${MODIPSL}/util/correct-cvs-diff.awk ${ MODIPSL}/cvs_diff_${save_diff_file}_00 > ${MODIPSL}/cvs_diff_${save_diff_file}_01274 ${MODIPSL}/util/correct-cvs-diff.awk ${tmpMODIPSL}/cvs_diff_${save_diff_file}_00 > ${tmpMODIPSL}/cvs_diff_${save_diff_file}_01 262 275 RET=$? 263 276 if ( ${DEBUG_mode} ); then 264 cp ${ MODIPSL}/cvs_diff_${save_diff_file}_01 ${SpathComp}/cvs_diff277 cp ${tmpMODIPSL}/cvs_diff_${save_diff_file}_01 ${SpathComp}/cvs_diff 265 278 else 266 mv ${ MODIPSL}/cvs_diff_${save_diff_file}_01 ${SpathComp}/cvs_diff267 rm ${ MODIPSL}/cvs_diff_${save_diff_file}_00279 mv ${tmpMODIPSL}/cvs_diff_${save_diff_file}_01 ${SpathComp}/cvs_diff 280 rm ${tmpMODIPSL}/cvs_diff_${save_diff_file}_00 268 281 fi 269 282 RET1=$? … … 311 324 ListPathRev[$i]=$( svn info | grep "R.vision_*:" | gawk -F ' ' '{print $2}' ) 312 325 313 svn diff -r ${ListPathRev[$i]} > ${ MODIPSL}/svn_diff_${save_diff_file}326 svn diff -r ${ListPathRev[$i]} > ${tmpMODIPSL}/svn_diff_${save_diff_file} 314 327 RET=$? 315 328 if [ $RET -gt 0 ] ; then … … 319 332 ListPathBranch[$i]="error" 320 333 else 321 svn status > ${ MODIPSL}/svn_status_${save_diff_file}322 set -A NewFiles -- $( grep "^? *\(.*\.${SUFFIXES}\|AA_.*\|BB_.*\)$" ${ MODIPSL}/svn_status_${save_diff_file} | sed -e "s&? *&&" )334 svn status > ${tmpMODIPSL}/svn_status_${save_diff_file} 335 set -A NewFiles -- $( grep "^? *\(.*\.${SUFFIXES}\|AA_.*\|BB_.*\)$" ${tmpMODIPSL}/svn_status_${save_diff_file} | sed -e "s&? *&&" ) 323 336 printDebugArray NewFiles 324 337 for file in ${NewFiles[@]} ; do … … 329 342 done 330 343 331 set -A ModifiedFiles -- $( grep "^M *" ${ MODIPSL}/svn_status_${save_diff_file} | sed -e "s&M *&&" )344 set -A ModifiedFiles -- $( grep "^M *" ${tmpMODIPSL}/svn_status_${save_diff_file} | sed -e "s&M *&&" ) 332 345 printDebugArray ModifiedFiles 333 346 for file in ${ModifiedFiles[@]} ; do … … 341 354 342 355 if ( ${DEBUG_mode} ); then 343 cp ${ MODIPSL}/svn_diff_${save_diff_file} ${SpathComp}/svn_diff356 cp ${tmpMODIPSL}/svn_diff_${save_diff_file} ${SpathComp}/svn_diff 344 357 else 345 rm ${ MODIPSL}/svn_status_${save_diff_file}346 mv ${ MODIPSL}/svn_diff_${save_diff_file} ${SpathComp}/svn_diff358 rm ${tmpMODIPSL}/svn_status_${save_diff_file} 359 mv ${tmpMODIPSL}/svn_diff_${save_diff_file} ${SpathComp}/svn_diff 347 360 fi 348 361 RET=$?
Note: See TracChangeset
for help on using the changeset viewer.