summaryrefslogtreecommitdiff
path: root/Build/cdbuild/dupl.pl
blob: c98ac231bb31a507723587d579adbcdeaeb25690 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/bin/perl
use English;
use Getopt::Long;
use FileHandle;
use File::Basename;
use File::Find;
use Cwd;
$_=`kpsewhich -expand-var '\$TEXMFDIST'`;
chop;
print "texmf is rooted at $_\n";
chdir $_ || die "cannot change directory to [$_]\n";
&Check("tex");
&Check("tex/plain");
&Check("tex/generic");
&Check("tex/latex");
&Check("doc");
&Check("source");
&Check("fonts");

sub Check{
(my $Dir) = @_;
print "\nDUPLICATES in $Dir\n";
find(\&lfiles,$Dir);
foreach $i (sort keys %Files) {
    $_ = $Files{$i};
    if (/ /) {     print "$i: $_\n"; 
		   @d=split(" ",$_,);
		   foreach  (@d) {
		       system "ls -l $_/$i >> /tmp/$$.log";
		   }
                   open (L,"/tmp/$$.log") || die "where is /tmp/$$.log?";
		   while (<L>) { print " $_";}
                   close L;
		   unlink "/tmp/$$.log";
	       }
   $Files{$i}="";
}
}
sub lfiles {
    if (-f) {   
	if (/README/) {}
	elsif (/MANIFEST/) {}
	elsif (/TODO/) {}
	elsif (/makefile/) {}
	elsif (/Makefile/) {}
	elsif (/READ.ME/) {}
	elsif (/readme/) {}
	elsif (/patch/) {}
	elsif (/Change/) {}
	elsif (/CHANGE/) {}
	elsif (/FILE/) {}
	elsif (/NOTE/) {}
	elsif (/INSTALL/) {}
	elsif (/install\.*/) {}
	elsif (/NEWS/) {}
	elsif (/CATALOG/) {}
	elsif (/catalog/) {}
	elsif (/changes\.*/) {}
	elsif (/ANNOUNCE/) {}
	elsif (/COPY/) {}
	elsif (/node.*html/) {}
	elsif (/index.html/) {}
	elsif (/example.*tex/) {}
	elsif (/example.*dvi/) {}
	elsif (/sample.*tex/) {}
	elsif (/sample.*dvi/) {}
	elsif (/\.pk$/) {}
	elsif (/\.gif$/) {}
	elsif (/\.inl$/) {}
else
    {   $dir=$File::Find::dir;
       if ( $Files{$_} ne "") { $Files{$_} .= " $dir"; }
	else { $Files{$_}=$dir; }}
 }
}