version 1.5, 2001/11/16 21:12:46
|
version 1.6, 2001/11/17 01:16:12
|
Line 47 Options (before file/dir names):
|
Line 47 Options (before file/dir names):
|
-q only show file names (based on first file/dir) |
-q only show file names (based on first file/dir) |
-v verbose mode (default) |
-v verbose mode (default) |
-bN buildmode (controls exit code of this script; 0 unless...) |
-bN buildmode (controls exit code of this script; 0 unless...) |
N=1: md5sum=same --> 2; cvstime<0 --> 1 |
N=1: md5sum=same --> 1; cvstime<0 --> 2 |
N=2: same as N=1 except without md5sum |
N=2: same as N=1 except without md5sum |
N=3: md5sum=same --> 1; age<0 --> 2 |
N=3: md5sum=same --> 1; age<0 --> 2 |
N=4: cvstime>0 --> 2 |
N=4: cvstime>0 --> 2 |
Line 64 unless (@ARGV) {
|
Line 64 unless (@ARGV) {
|
# |
# |
# Ways of comparison: |
# Ways of comparison: |
# existence similarity |
# existence similarity |
# cvs time similarity (first argument treated as CVS source) |
# cvs time similarity (1st arg treated as CVS source; only for buildmode) |
# age similarity (modification time) |
# age similarity (modification time) |
# md5sum similarity |
# md5sum similarity |
# size similarity (bytes) |
# size similarity (bytes) |
Line 95 unless (@ARGV) {
|
Line 95 unless (@ARGV) {
|
my $verbose='1'; |
my $verbose='1'; |
my $show='all'; |
my $show='all'; |
my $buildmode=0; |
my $buildmode=0; |
while (@ARGV) { |
ALOOP: while (@ARGV) { |
my $flag; |
my $flag; |
if ($ARGV[0]=~/^\-(\w)/) { |
if ($ARGV[0]=~/^\-(\w)/) { |
$flag=$1; |
$flag=$1; |
if ($flag eq 'b') { |
if ($flag eq 'b') { |
$ARGV[0]=~/^\-\w(\d)/; |
$ARGV[0]=~/^\-\w(\d)/; |
$buildmode=$1; |
$buildmode=$1; |
|
shift @ARGV; |
|
next ALOOP; |
} |
} |
shift @ARGV; |
shift @ARGV; |
SWITCH: { |
SWITCH: { |
Line 230 FLOOP: foreach my $file (@files) {
|
Line 232 FLOOP: foreach my $file (@files) {
|
$diffs='n/a'; |
$diffs='n/a'; |
} |
} |
else { |
else { |
my ($cvstime1,$cvstime2)=&{$MEASURE{'cvstime'}}($file1,$file2); |
if ($buildmode) { |
$cvstime=$cvstime1-$cvstime2; |
my ($cvstime1,$cvstime2)=&{$MEASURE{'cvstime'}}($file1,$file2); |
|
$cvstime=$cvstime1-$cvstime2; |
|
} |
|
else { |
|
$cvstime='n/a'; |
|
} |
my ($age1,$age2)=&{$MEASURE{'age'}}($file1,$file2); |
my ($age1,$age2)=&{$MEASURE{'age'}}($file1,$file2); |
$age=$age1-$age2; |
$age=$age1-$age2; |
my ($md5sum1,$md5sum2)=&{$MEASURE{'md5sum'}}($file1,$file2); |
my ($md5sum1,$md5sum2)=&{$MEASURE{'md5sum'}}($file1,$file2); |
Line 239 FLOOP: foreach my $file (@files) {
|
Line 246 FLOOP: foreach my $file (@files) {
|
$md5sum='same'; |
$md5sum='same'; |
$size=0; |
$size=0; |
$lines=0; |
$lines=0; |
$diffs=0; |
$diffs='0:0'; |
} |
} |
elsif ($md5sum1 ne $md5sum2) { |
elsif ($md5sum1 ne $md5sum2) { |
$md5sum='different'; |
$md5sum='different'; |
Line 271 FLOOP: foreach my $file (@files) {
|
Line 278 FLOOP: foreach my $file (@files) {
|
$showflag=1; |
$showflag=1; |
} |
} |
} |
} |
elsif ($key eq 'cvstime') { |
elsif ($key eq 'cvstime' and $buildmode) { |
if ($cvstime!=0) { |
if ($cvstime!=0) { |
$showflag=1; |
$showflag=1; |
} |
} |
Line 307 FLOOP: foreach my $file (@files) {
|
Line 314 FLOOP: foreach my $file (@files) {
|
@ks=('existence','md5sum','cvstime','age','size','lines','diffs'); |
@ks=('existence','md5sum','cvstime','age','size','lines','diffs'); |
} |
} |
my $showcount=length(@ks); |
my $showcount=length(@ks); |
|
$showcount-- unless $buildmode; |
FLOOP3: for my $key (@ks) { |
FLOOP3: for my $key (@ks) { |
if ($key eq 'existence') { |
if ($key eq 'existence') { |
if ($existence ne 'yes:yes') { |
if ($existence ne 'yes:yes') { |
Line 318 FLOOP: foreach my $file (@files) {
|
Line 326 FLOOP: foreach my $file (@files) {
|
$showcount--; |
$showcount--; |
} |
} |
} |
} |
elsif ($key eq 'cvstime') { |
elsif ($key eq 'cvstime' and $buildmode) { |
if ($cvstime!=0) { |
if ($cvstime!=0) { |
$showcount--; |
$showcount--; |
} |
} |
Line 386 FLOOP: foreach my $file (@files) {
|
Line 394 FLOOP: foreach my $file (@files) {
|
exit(0); |
exit(0); |
} |
} |
} |
} |
print "$file"; |
if ($showflag) { |
if ($verbose==1) { |
print "$file"; |
print "\t"; |
if ($verbose==1) { |
print &{$OUTPUT{'existence'}}($existence); |
print "\t"; |
print "\t"; |
print &{$OUTPUT{'existence'}}($existence); |
print &{$OUTPUT{'cvstime'}}($cvstime); |
print "\t"; |
print "\t"; |
print &{$OUTPUT{'cvstime'}}($cvstime); |
print &{$OUTPUT{'age'}}($age); |
print "\t"; |
print "\t"; |
print &{$OUTPUT{'age'}}($age); |
print &{$OUTPUT{'md5sum'}}($md5sum); |
print "\t"; |
print "\t"; |
print &{$OUTPUT{'md5sum'}}($md5sum); |
print &{$OUTPUT{'size'}}($size); |
print "\t"; |
print "\t"; |
print &{$OUTPUT{'size'}}($size); |
print &{$OUTPUT{'lines'}}($lines); |
print "\t"; |
print "\t"; |
print &{$OUTPUT{'lines'}}($lines); |
print &{$OUTPUT{'diffs'}}($diffs); |
print "\t"; |
|
print &{$OUTPUT{'diffs'}}($diffs); |
|
} |
|
print "\n"; |
} |
} |
print "\n"; |
|
} |
} |
|
|
# ----------------------------------------------------------------- Subroutines |
# ----------------------------------------------------------------- Subroutines |