File: tdiff

package info (click to toggle)
libtk-tablematrix-perl 1.22-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,624 kB
  • ctags: 1,274
  • sloc: ansic: 15,026; perl: 3,376; makefile: 156; sh: 16
file content (29 lines) | stat: -rwxr-xr-x 674 bytes parent folder | download | duplicates (11)
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
#!/usr/local/bin/perl -w

sub fail
{
 warn shift(@_)."\n";
 return undef;
}
 
sub tdiff
{
 my $file = shift;          
 my ($src) = grep(-r $_,map("mTk/$_/$file",qw(unix win generic tclGeneric)));
 return fail("Cannot find $file in mTk") unless $src; 
 my ($tcl) = grep(-r $_,map("../../../tcltk/$_/$file",qw(unix win generic)));
 ($tcl) = grep(-r $_,map("../../../tcl/$_/$file",qw(unix win generic))) unless $tcl;
 return fail("Cannot find $file in tcltk") unless $tcl; 
 print "$tcl\n$src\n";      
 system("diff -u $tcl $src > /tmp/$file");
 return "/tmp/$file";
}

if (@ARGV)
 {
  foreach (@ARGV)
   {
    my $file = tdiff($_);
    system("ned",$file) if $file;
   }
 }