#! /bin/csh -f # # difffsfast # # Original Author: Doug Greve # CVS Revision Info: # $Author: greve $ # $Date: 2010/04/10 00:13:10 $ # $Revision: 1.5 $ # # Copyright (C) 2002-2007, # The General Hospital Corporation (Boston, MA). # All rights reserved. # # Distribution, usage and copying of this software is covered under the # terms found in the License Agreement file named 'COPYING' found in the # FreeSurfer source code root directory, and duplicated here: # https://surfer.nmr.mgh.harvard.edu/fswiki/FreeSurferOpenSourceLicense # # General inquiries: freesurfer@nmr.mgh.harvard.edu # Bug reports: analysis-bugs@nmr.mgh.harvard.edu # set ShowNoExist = 1; if($#argv != 2 && $#argv != 3) then echo "USAGE: difffsfast fs1 fs2 " exit 1; endif set fs1 = $argv[1]; set fs2 = $argv[2]; if($#argv == 3) then set showdiff = 1; else set showdiff = 0; endif set D = '$'; # Check each file in fs1 toolbox against that in fs2 foreach m1 ($fs1/toolbox/*.m) set b = `basename $m1`; set m2 = $fs2/toolbox/$b if(! -e $m2) then if($ShowNoExist) then echo "----------------------------------------" echo "$b exists in $fs1 but not in $fs2" endif else # Can't use $ before Id because cvs substitutes it set cmd = (diff -b -B -I 'Id: ' -I 'Date:' -I 'Author:' \ -I 'Revision:' -I '^#' -I '^%' $m1 $m2) set n = `$cmd | wc -l` if($n != 0) then echo "----------------------------------------" echo "$b differs" if($showdiff) $cmd endif endif end # Check each file in fs2 toolbox against that in fs1 # existence only foreach m2 ($fs2/toolbox/*.m) set b = `basename $m2`; set m1 = $fs1/toolbox/$b if(! -e $m1 && $ShowNoExist) then echo "----------------------------------------" echo "$b exists in $fs2 but not in $fs1" endif end # Check each file in fs1 bin against that in fs2 foreach m1 ($fs1/bin/*) if(-d $m1) continue; set b = `basename $m1`; set m2 = $fs2/bin/$b if(! -e $m2) then if($ShowNoExist) then echo "----------------------------------------" echo "$b exists in $fs1 but not in $fs2" endif else set cmd = (diff -b -B -I 'Id: ' -I 'Date:' -I 'Author:' \ -I 'Revision:' -I '^#' -I '^%' $m1 $m2) set n = `$cmd | wc -l` if($n != 0) then echo "----------------------------------------" echo "$b differs" if($showdiff) $cmd endif endif end # Check each file in fs2 bin against that in fs1 # existence only foreach m2 ($fs2/bin/*) if(-d $m2) continue; set b = `basename $m2`; set m1 = $fs1/bin/$b if(! -e $m1) then echo "----------------------------------------" echo "$b exists in $fs2 but not in $fs1" endif end echo "----------------------------------------" exit 0