File: genexc

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 (49 lines) | stat: -rwxr-xr-x 768 bytes parent folder | download | duplicates (21)
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
#!/usr/local/bin/perl -w

my %mTk;
my $dir;
my @list;
if ($^O eq 'MSWin32')
 {
  @list = qw(win xlib generic tix tclWin tclGeneric);
 }
else
 {
  @list = qw(unix generic tix tclUnix tclGeneric );
 }
foreach $dir (@list)
 {
  my %exc;
  my $src = catdir("mTk",$dir);
  next unless -d $src;
  opendir(DIR,$src) || die "Cannot open $src:$!";
  open(EXC,">".catfile($src,"pTk.exc"));
  my $file;
  while (defined($file = readdir(DIR)))
   {
    next if $exc{$_};
    if ($file =~ /\.[ch]$/)
     {
      my $o = $file;
      $o =~ s/\.c$/.o/;
      unless (-f $o)
       {
        print EXC "$file\n";
        unlink($file) if (-f $file);
       }
     }
   }
  closedir(DIR);
  close(EXC);
 }

sub catfile
{
 return join('/',@_);
}

sub catdir
{
 return join('/',@_);
}