version 1.8, 2001/11/17 23:00:10
|
version 1.9, 2001/12/06 00:23:16
|
Line 8
|
Line 8
|
# 9/27, 10/24, 10/25, 11/4 Scott Harrison |
# 9/27, 10/24, 10/25, 11/4 Scott Harrison |
# 11/14 Guy Albertelli |
# 11/14 Guy Albertelli |
# 11/16,11/17 Scott Harrison |
# 11/16,11/17 Scott Harrison |
|
# 12/3,12/5 Scott Harrison |
# |
# |
# $Id$ |
# $Id$ |
### |
### |
Line 34 my $invocation=<<END;
|
Line 35 my $invocation=<<END;
|
filecompare.pl [ options ... ] [FILE1] [FILE2] [ restrictions ... ] |
filecompare.pl [ options ... ] [FILE1] [FILE2] [ restrictions ... ] |
or |
or |
filecompare.pl [ options ... ] [DIR1] [DIR2] [ restrictions ... ] |
filecompare.pl [ options ... ] [DIR1] [DIR2] [ restrictions ... ] |
|
or |
|
filecompare.pl [ options ... ] -s TARGET=[target] SOURCE=[source] MODE=[mode] |
|
LOC1 LOC2 |
|
|
Restrictions: a list of space separated values (after the file/dir names) |
Restrictions: a list of space separated values (after the file/dir names) |
can restrict the comparison. |
can restrict the comparison. |
Line 51 Options (before file/dir names):
|
Line 55 Options (before file/dir names):
|
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 |
|
|
|
The third way to pass arguments is set by the -s flag. |
|
filecompare.pl -s SOURCE=[source] TARGET=[target] MODE=[mode] LOC1 LOC2 |
|
|
|
TARGET corresponds to the root path of LOC2. SOURCE corresponds to |
|
the root path of LOC1. MODE can either be file, directory, link, or fileglob. |
|
|
END |
END |
unless (@ARGV) { |
unless (@ARGV) { |
print $invocation; |
print $invocation; |
Line 92 unless (@ARGV) {
|
Line 103 unless (@ARGV) {
|
# -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 build/install mode (returns exitcode) |
# -bN build/install mode (returns exitcode) |
|
# -s status checking mode for lpml |
|
|
my $verbose='1'; |
my $verbose='1'; |
my $show='all'; |
my $show='all'; |
my $buildmode=0; |
my $buildmode=0; |
|
my $statusmode=0; |
ALOOP: while (@ARGV) { |
ALOOP: while (@ARGV) { |
my $flag; |
my $flag; |
if ($ARGV[0]=~/^\-(\w)/) { |
if ($ARGV[0]=~/^\-(\w)/) { |
Line 112 ALOOP: while (@ARGV) {
|
Line 126 ALOOP: while (@ARGV) {
|
$show='same', last SWITCH if $flag eq 'p'; |
$show='same', last SWITCH if $flag eq 'p'; |
$show='different', last SWITCH if $flag eq 'n'; |
$show='different', last SWITCH if $flag eq 'n'; |
$show='all', last SWITCH if $flag eq 'a'; |
$show='all', last SWITCH if $flag eq 'a'; |
|
$statusmode=1, last SWITCH if $flag eq 's'; |
print($invocation), exit(1); |
print($invocation), exit(1); |
} |
} |
} |
} |
Line 122 ALOOP: while (@ARGV) {
|
Line 137 ALOOP: while (@ARGV) {
|
dowarn('Verbose: '.$verbose."\n"); |
dowarn('Verbose: '.$verbose."\n"); |
dowarn('Show: '.$show."\n"); |
dowarn('Show: '.$show."\n"); |
|
|
|
my @files; |
|
my $loc1; |
|
my $loc2; |
|
# ----------------------------------------- If status checking mode for lpml |
|
my ($sourceroot,$targetroot,$mode,$sourceglob,$targetglob); |
|
my ($source,$target); |
|
if ($statusmode==1) { |
|
($sourceroot,$targetroot,$mode,$sourceglob,$targetglob)=splice(@ARGV,0,5); |
|
$targetroot.='/' if $targetroot!~/\/$/; |
|
$sourceroot=~s/^SOURCE\=//; |
|
$targetroot=~s/^TARGET\=//; |
|
$source=$sourceroot.'/'.$sourceglob; |
|
$target=$targetroot.''.$targetglob; |
|
# print "SOURCE: $source\n"; |
|
# print "TARGET: $target\n"; |
|
if ($mode eq 'MODE=fileglob') { |
|
@files=glob($source); |
|
} |
|
} |
|
else { |
|
|
# ----------------------------------------- Process file/dir location arguments |
# ----------------------------------------- Process file/dir location arguments |
# FILE1 FILE2 or DIR1 DIR2 |
# FILE1 FILE2 or DIR1 DIR2 |
my $loc1=shift @ARGV; |
$loc1=shift @ARGV; |
my $loc2=shift @ARGV; |
$loc2=shift @ARGV; |
my $dirmode='directories'; |
my $dirmode='directories'; |
my @files; |
|
unless ($loc1 and $loc2) { |
unless ($loc1 and $loc2) { |
|
print "LOC1: $loc1\nLOC2: $loc2\n"; |
print($invocation), exit(1); |
print($invocation), exit(1); |
} |
} |
if (-f $loc1) { |
if (-f $loc1) { |
Line 147 else {
|
Line 183 else {
|
dowarn('Processing for mode: '.$dirmode."\n"); |
dowarn('Processing for mode: '.$dirmode."\n"); |
dowarn('Location #1: '.$loc1."\n"); |
dowarn('Location #1: '.$loc1."\n"); |
dowarn('Location #2: '.$loc2."\n"); |
dowarn('Location #2: '.$loc2."\n"); |
|
} |
# --------------------------------------------- Process comparison restrictions |
# --------------------------------------------- Process comparison restrictions |
# A list of space separated values (after the file/dir names) |
# A list of space separated values (after the file/dir names) |
# can restrict the comparison. |
# can restrict the comparison. |