source: tags/ms_r16q2/util/arb_srclst.pl

Last change on this file was 14808, checked in by westram, 8 years ago
  • allow .patch files in HEADERLIBS
  • use INT_MAX instead of numeric_limits
  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 22.5 KB
Line 
1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
6my $debug_matching = 0; # set to 1 to view file matching and decision
7my $ignore_unknown = 0;
8
9# ------------------------------------------------------------
10# override checks below and save strictly as checked-in in SVN
11
12my @strictly_as_in_svn_when_matchesDir = (
13                                           qr/\/GDE\/MAFFT\/mafft-[0-9\.]+-with[out]*-extensions/o,
14                                          );
15
16# ------------------------------------------------------------
17# skipped_directories and files inside are never examined:
18
19my @skipped_directories = (
20                           qr/\/.+\/bin$/o,
21                           qr/\/.+\/build$/o,
22                           qr/\/lib\/sativa$/o,
23                           qr/\/HELP_SOURCE\/Xml$/o,
24                           qr/\/GDE\/MUSCLE\/obj$/o,
25                           qr/\/GDE\/PHYML20130708\/phyml\/autom4te.cache$/o,
26                           qr/\/GDE\/RAxML8\/builddir/o,
27                           qr/\/GDE\/SATIVA\/builddir/o,
28                           qr/\/ignore\./o,
29                           qr/\/PERL2ARB\/blib$/o,
30                           qr/\/HEADERLIBS\/[^\/]+/o,
31                           qr/\/UNIT_TESTER\/logs$/o,
32                           qr/\/UNIT_TESTER\/tests$/o,
33                           qr/\/UNIT_TESTER\/tests\.slow$/o,
34                           qr/\/UNIT_TESTER\/run\/homefake\/.arb_prop\/(macros|cfgSave)$/o,
35                           qr/^\.\/ARB_SOURCE_DOC/o,
36                           qr/^\.\/dep_graphs/o,
37                           qr/^\.\/INCLUDE$/o,
38                           qr/^\.\/lib\/help$/o,
39                           qr/^\.\/lib\/help_html$/o,
40                           qr/^\.\/lib\/pts$/o,
41                           qr/^\.\/lib\/mafft$/o,
42                           qr/^\.\/patches.arb$/o,
43                           qr/^\.\/PERL5$/o,
44                           qr/_COM\/DUMP$/o,
45                           qr/_COM\/GEN[CH]$/o,
46                           qr/_COM\/O$/o,
47                           qr/_GEN$/o,
48                           qr/nbproject/o,
49                           # needed by ralf:
50                           qr/^\.\/test_arb_make_targets_logs/o,
51                           qr/\.dSYM$/o,
52                          );
53
54# first used/skipped match wins (exception see @3 below)
55
56my %used_files = map { $_ => 1; } (
57                                   '!BRANCH_STATE',
58                                   'AUTHORS',
59                                   'COPYING',
60                                   'demo.arb',
61                                   'Doxyfile',
62                                   'export2sub',
63                                   'Makefile',
64                                   'Makefile.org',
65                                   'Makefile.setup.include',
66                                   'Makefile.setup.template',
67                                   'Makefile.suite',
68                                   'Makefile.test',
69                                   'needs_libs',
70                                  );
71
72my %skipped_files = map { $_ => 1; } (
73                                      '.build.lst',
74                                      '.cvsignore',
75                                      '.depends',
76                                      'ChangeLog',
77                                      'config.makefile',
78                                      'helpfiles.lst',
79                                      'last.success',
80                                      'Makefile.setup.local',
81                                      'makeloc.here',
82                                      'makeloc.here',
83                                      'nt_date.h',
84                                      'postcompile.sav',
85                                      'TAGS',
86                                      '.DS_Store',
87                                      );
88
89my %used_extensions = map { $_ => 1; } ( # matches part behind last '.' in filename
90                                        'c', 'cpp', 'cxx', 'cc',
91                                        'h', 'hpp', 'hxx',
92
93                                        'aisc', 'pa',
94                                        'bitmap',
95                                        'dtd', 'xsl',
96                                        'f',
97                                        'footer',
98                                        'head', 'header',
99                                        'i',  # swig input
100                                        'inc',
101                                        'java', 'manifest',
102                                        'makefile',
103                                        'pl', 'pm', 'PL', 'cgi', 'xs',
104                                        'awk',
105                                        'py',
106                                        'script',
107                                        'sh',
108                                        'source', 'menu',
109                                        'template', 'default',
110                                        'txt', 'doc', 'ps', 'pdf',
111                                        'tgz', 'gz',
112                                        'svg', 'png',
113                                        'xpc',
114                                       );
115
116my %skipped_extensions = map { $_ => 1; } ( # matches part behind last '.' in filename
117                                           'a',
118                                           'bak',
119                                           'class',
120                                           'bundle', # Some file from XCode
121                                           'gcno',
122                                           'genmenu',
123                                           'jar',
124                                           'last_gcc',
125                                           'last_compiler',
126                                           'list',
127                                           'log',
128                                           'o',
129                                           'old',
130                                           'patch',
131                                           'rej',
132                                           'so',
133                                           'stamp',
134                                           'swp',
135                                           'yml', 'json', # perl2arb
136                                          );
137
138
139# used_when_matches, skipped_when_matches and used_when_matchesFull are only tested,
140# if above filters did not match:
141
142my @used_when_matches = (
143                         qr/^arb_.*\.txt$/o,
144                         qr/disclaimer/io,
145                         qr/license/io,
146                         qr/needs_libs\..*/io,
147                         qr/readme$/io,
148                         qr/typemap$/io,
149                        );
150
151my @skipped_when_matches = (
152                            qr/.*~$/o, # backups
153                            qr/\#.*\#$/o,
154                            qr/\.\#.*$/o,
155                            qr/^arbsrc.*\.tgz$/o,
156                            qr/^arbsrc\.lst$/o,
157                            qr/^arbsrc\.lst\.tmp$/o,
158                            qr/^callgrind\./o,
159                           );
160
161my @used_when_matchesFull = (
162                             qr/\/AISC_COM\/AISC\/magic.lst$/o,
163                             qr/\/CLUSTALW\/.*$/o,
164                             qr/\/EISPACK\/rg\.html$/o,
165                             qr/\/GDE\/.*\.html$/o,
166                             qr/\/GDEHELP\/FASTA/o,
167                             qr/\/GDEHELP\/GDE.*/o,
168                             qr/\/GDEHELP\/HELP_PLAIN/o,
169                             qr/\/GDEHELP\/HELP_WRITTEN/o,
170                             qr/\/GDEHELP\/Makefile\.helpfiles/o,
171                             qr/\/HEADERLIBS\/.*COPYING$/o,
172                             qr/\/HELP_SOURCE\/.*\.gif$/o,
173                             qr/\/HELP_SOURCE\/oldhelp\/.*\.(ps|pdf)\.gz$/o,
174                             qr/\/HELP_SOURCE\/oldhelp\/.*\.hlp$/o,
175                             qr/\/HGL_SRC\/plot\.icon$/o,
176                             qr/\/PERL2ARB\/.*\.html$/o,
177                             qr/\/PERL2ARB\/Makefile.main$/o,
178                             qr/\/PHYLIP\/doc\//o,
179                             qr/\/PROBE_SERVER\/.*\.conf$/o,
180                             qr/\/READSEQ\/.*\.help$/o,
181                             qr/\/READSEQ\/Formats$/o,
182                             qr/\/SH\/[^\/\.]*$/o,
183                             qr/\/SOURCE_TOOLS\//o,
184                             qr/\/TREEPUZZLE\/.*\.gif$/o,
185                             qr/\/UNIT_TESTER\/run\/.*\.a00$/o,
186                             qr/\/UNIT_TESTER\/run\/.*\.arb$/o,
187                             qr/\/UNIT_TESTER\/run\/.*\.amc$/o,
188                             qr/\/UNIT_TESTER\/run\/.*\.expected$/o,
189                             qr/\/UNIT_TESTER\/run\/.*\.fig$/o,
190                             qr/\/UNIT_TESTER\/run\/.*\.in$/o,
191                             qr/\/UNIT_TESTER\/run\/.*\.inp$/o,
192                             qr/\/UNIT_TESTER\/run\/.*\.input$/o,
193                             qr/\/UNIT_TESTER\/run\/.*\.out$/o,
194                             qr/\/UNIT_TESTER\/run\/.*\.tree$/o,
195                             qr/\/UNIT_TESTER\/run\/help\//o,
196                             qr/\/UNIT_TESTER\/run\/impexp\/.*\.exported$/o,
197                             qr/\/UNIT_TESTER\/valgrind\/arb_valgrind_logged$/o,
198                             qr/^\.\/etc\//o,
199                             qr/^\.\/lib\/arb_default\/.*\.arb$/o,
200                             qr/^\.\/lib\/arb_tcp_org\.dat$/o,
201                             qr/^\.\/lib\/config\.[^\.]+$/io,
202                             qr/^\.\/lib\/desktop\/.*$/o,
203                             qr/^\.\/lib\/export\/.*\.eft$/o,
204                             qr/^\.\/lib\/import\/.*\.ift2?$/o,
205                             qr/^\.\/lib\/inputMasks\/.*\.mask$/o,
206                             qr/^\.\/lib\/macros\/.*\.amc$/o,
207                             qr/^\.\/lib\/macros\/.checks\/.*\.expected$/o,
208                             qr/^\.\/lib\/nas\/names\.dat\.template$/o,
209                             qr/^\.\/lib\/pictures\/.*\.(fig|vfont)$/o,
210                             qr/^\.\/lib\/pixmaps\/.*\.xpm$/o,
211                             qr/^\.\/lib\/protein_2nd_structure\/.*\.dat$/o,
212                             qr/^\.\/lib\/rna3d\/.*\.(pdb|data)$/o,
213                             qr/^\.\/lib\/rna3d\/images\/.*\.png$/o,
214                             qr/^\.\/lib\/sellists\/.*\.sellst$/o,
215                             qr/^\.\/lib\/submit\//o,
216                             qr/^\.\/lib\/BUGS\//o,
217                             qr/^\.\/util\/arb_.*$/o,
218                             qr/^\.\/util\/config\..*$/o,
219                             qr/\/GDE\/.*\/Makefile\.[^\/]+$/io,
220                             qr/\/GDE\/PHYML[^\/]+\/phyml\//o,
221                             qr/\/GDE\/SATIVA\/sativa\//o,
222                            );
223
224# skipped_when_matchesFull and forced_when_matchesFull are always tested! (@3)
225
226my @skipped_when_matchesFull = (
227                                qr/\/genhelp\/.*\.hlp$/o,
228                                qr/\/lib\/addlibs\/(lib.*\.so\..*)$/o,
229                                qr/^\.\/arb.*\.tgz$/o,
230                                qr/^\.\/bin\//o,
231                                qr/^\.\/GDE\/CORE\/functions.h$/o,
232                                qr/^\.\/GDE\/PHYML[^\/]+\/phyml\/(configure|config.h.in)$/o,
233                                qr/\/HELP_SOURCE\/help_map\.gif$/o,
234                                qr/^\.\/lib\/ARB\.pm$/o,
235                                qr/^\.\/lib\/arb_tcp\.dat$/o,
236                                qr/^\.\/lib\/gde\/.*\.menu$/o,
237                                qr/^\.\/lib\/nas\/names.*\.dat$/o,
238                                qr/^\.\/lib\/macros\/\.checks\/.*\.ids$/o,
239                                qr/^\.\/lib\/motifHack\/pixmaps\/.*$/o,
240                                qr/^\.\/PERL2ARB\/.*\.h$/o,
241                                qr/^\.\/PERL2ARB\/ARB\.bs$/o,
242                                qr/^\.\/PERL2ARB\/ARB\.c$/o,
243                                qr/^\.\/PERL2ARB\/ARB\.xs$/o,
244                                qr/^\.\/PERL2ARB\/Makefile$/o,
245                                qr/^\.\/PERL2ARB\/Makefile.PL$/o,
246                                qr/^\.\/PERL2ARB\/perlmain.c$/o,
247                                qr/^\.\/PERL2ARB\/pm_to_blib$/o,
248                                qr/^\.\/SOURCE_TOOLS\/valgrind2grep\.lst$/o,
249                                qr/^\.\/SOURCE_TOOLS\/stamp\./o,
250                                qr/^\.\/TEMPLATES\/arb_build\.h$/o,
251                                qr/^\.\/UNIT_TESTER\/run\/TEST_g?pt\.arb$/o,
252                                qr/^\.\/UNIT_TESTER\/run\/.*\.ARM$/o,
253                                qr/^\.\/UNIT_TESTER\/run\/.*\.ARF$/o,
254                                qr/^\.\/UNIT_TESTER\/Makefile\.setup\.local\.last$/o,
255                                qr/^\.\/TAGS\./o, # avoid failure while 'make tags' is running
256                                qr/date\.xsl$/o,
257                               );
258
259my @forced_when_matchesFull = (
260                               qr/^\.\/bin\/Makefile/o,
261                               qr/\/PROBE_WEB\/SERVER\/.*\.jar$/o,
262                               qr/\/GDE\/PHYML[^\/]+\/phyml\/.*\.log$/o,
263                               qr/\/UNIT_TESTER\/run\/.*\.list$/o,
264                               qr/\/HEADERLIBS\/.*\.patch$/o,
265                              );
266
267# files that are even packed when generated and not in VC
268my @pack_fullGenerated = (
269                          qr/\/TEMPLATES\/svn_revision\.h$/o,
270                          qr/\/lib\/revision_info\.txt$/o,
271                         );
272
273# ------------------------------------------------------------
274# sanity checks
275
276foreach (keys %used_extensions) {
277  if (exists $skipped_extensions{$_}) { die "'$_' in \$used_extensions and \$skipped_extensions"; }
278}
279foreach (keys %used_files) {
280  if (exists $skipped_files{$_}) { die "'$_' in \$used_files and \$skipped_files"; }
281}
282
283# ------------------------------------------------------------
284
285sub useDir($) {
286  my ($dir) = @_;
287
288  if ($dir =~ /.svn$/o) { return 0; }
289  if ($dir =~ /CVS$/o) { return 0; }
290  foreach (@skipped_directories) {
291    if ($dir =~ $_) { return 0; }
292  }
293  return 1;
294}
295
296sub matchingExpr($\@) {
297  # return 0 if no regexp matched, return index+1 otherwise
298  my ($str,$regexp_arr_r) = @_;
299
300  my $regexps = scalar(@$regexp_arr_r);
301  for (my $r=0; $r<$regexps; $r++) {
302    my $reg = $$regexp_arr_r[$r];
303    if ($str =~ $reg) {
304      return $r+1;
305    }
306  }
307  return 0;
308}
309
310sub useIfMatching($\@\$) {
311  my ($str,$regexp_arr_r,$use_r) = @_;
312  my $matches = matchingExpr($str,@$regexp_arr_r);
313  if ($matches>0) {
314    if ($debug_matching!=0) { print STDERR "'$str' matches '".$$regexp_arr_r[$matches-1]."' => use!\n"; }
315    $$use_r = 1;
316  }
317}
318sub dontUseIfMatching($\@\$) {
319  my ($str,$regexp_arr_r,$use_r) = @_;
320  my $matches = matchingExpr($str,@$regexp_arr_r);
321  if ($matches>0) {
322    if ($debug_matching!=0) { print STDERR "'$str' matches '".$$regexp_arr_r[$matches-1]."' => don't use!\n"; }
323    $$use_r = 0;
324  }
325}
326
327sub useFile($$) {
328  my ($dir,$file) = @_;
329
330  my $use = undef;
331  if (exists $used_files{$file}) { $use = 1; }
332  elsif (exists $skipped_files{$file}) { $use = 0; }
333
334  my $hasExt = 0;
335  if (not defined $use) {
336    if ($file =~ /\.([^\.]+)$/o) {
337      my $ext = $1;
338      $hasExt = 1;
339      if (exists $used_extensions{$ext}) {
340        if ($debug_matching!=0) { print STDERR "'$file' matches extension '".$ext."' => use!\n"; }
341        $use = 1;
342      }
343      elsif (exists $skipped_extensions{$ext}) {
344        if ($debug_matching!=0) { print STDERR "'$file' matches extension '".$ext."' => don't use!\n"; }
345        $use = 0;
346      }
347    }
348  }
349
350  if (not defined $use) {
351    useIfMatching($file,@used_when_matches, $use);
352  }
353
354  if (not defined $use) {
355    dontUseIfMatching($file,@skipped_when_matches, $use);
356  }
357
358  my $full;
359  if (not defined $use) {
360    $full = $dir.'/'.$file;
361
362    useIfMatching($full,@used_when_matchesFull, $use);
363    if (not defined $use) {
364      if (-X $full and $hasExt==0) { $use = 0; } # exclude binaries by default (wrong for scripts)
365    }
366  }
367
368  if (not defined $use or $use==1) {
369    if (not defined $full) { $full = $dir.'/'.$file; }
370
371    dontUseIfMatching($full,@skipped_when_matchesFull, $use);
372  }
373  if (not defined $use or $use==0) {
374    if (not defined $full) { $full = $dir.'/'.$file; }
375    useIfMatching($full,@forced_when_matchesFull, $use);
376  }
377
378  if (not defined $use) {
379    if ($ignore_unknown==0) {
380      die "Don't know whether to use or skip '$file' (in $dir)";
381    }
382    $use = 1;
383  }
384
385  return $use;
386}
387
388# ------------------------------------------------------------
389
390my $VC_FILE    = 1;
391my $VC_DIR     = 2;
392my $VC_UNKNOWN = 3; # in SVN, but unknown whether dir or file
393
394my $svn_entries_read = 0;
395my %all_svn_entries = ();
396
397sub isSVNcheckout($) {
398  my ($dir) = @_;
399  if (-f $dir.'/.svn/entries') { return 1; }
400  if (-f $dir.'/.svn/wc.db') { return 1; }
401  return 0;
402}
403
404sub getSVNEntries($\%) {
405  my ($dir,$SVN_r) = @_;
406
407  if ($svn_entries_read==0) { # first call
408    if (isSVNcheckout($dir)==0) { return 0; }
409
410    my $cmd = "svn status -v $dir";
411    open(SVNSTATUS, "$cmd|") || die "failed to execute '$cmd' (Reason: $!)";
412
413    eval {
414      my $reg_status_line = qr/^(.*)\s+[0-9]+\s+[0-9]+\s+[^\s]+\s+([^\s]+)$/;
415
416      my $line;
417      while (defined($line=<SVNSTATUS>)) {
418        chomp($line);
419        if ($line =~ $reg_status_line) {
420          my ($flags,$name) = ($1,$2);
421          if (-f $name) {
422            $all_svn_entries{$name} = $VC_FILE;
423          }
424          elsif (-d $name) {
425            $all_svn_entries{$name} = $VC_DIR;
426          }
427          else {
428            $all_svn_entries{$name} = $VC_UNKNOWN;
429          }
430        }
431        else {
432          if ($line =~ /^?/) {
433            ; # silently ignore unknown files
434          }
435          else {
436            die "Cant parse line '$line'";
437          }
438        }
439      }
440    };
441    if ($@) {
442      die "Failed to read svn status: $@";
443    }
444
445    close(SVNSTATUS);
446    $svn_entries_read = 1;
447  }
448
449  if ($dir eq '.') {
450    foreach (keys %all_svn_entries) {
451      if (not /\//) { # root entry
452        $$SVN_r{$_} = $all_svn_entries{$_};
453      }
454    }
455  }
456  else {
457    if (not $dir =~ /^\.\//) { die "expected '$dir' to start with './'"; }
458    my $sdir = $';
459    my $reg_matchdir = qr/^$sdir\//;
460    foreach (keys %all_svn_entries) {
461      if ($_ =~ $reg_matchdir) {
462        my $rest = $';
463        if (not $rest =~ /\//) { # in $dir (not below)
464          $$SVN_r{$rest} = $all_svn_entries{$_};
465        }
466      }
467    }
468  }
469
470  return 1;
471}
472
473sub getCVSEntries($\%) {
474  my ($dir,$CVS_r) = @_;
475
476  my $cvsentries = $dir.'/CVS/Entries';
477  if (-f $cvsentries) {
478    open(CVS,'<'.$cvsentries) || die "can't read '$cvsentries' (Reason: $!)";
479    eval {
480      foreach (<CVS>) {
481        chomp;
482        if (/^D\/([^\/]+)\//o) { # directory
483          $$CVS_r{$1} = $VC_DIR;
484        }
485        elsif (/^\/([^\/]+)\//o) { # file
486          $$CVS_r{$1} = $VC_FILE;
487        }
488        elsif (/^D$/o) {
489          ;
490        }
491        else {
492          die "can't parse line '$_'";
493        }
494      }
495    };
496    if ($@) { die "$@ while reading $cvsentries"; }
497    close(CVS);
498    return 1;
499  }
500  return 0;
501}
502
503my $VC = '<no VC>';
504
505sub getVCEntries($\%) {
506  my ($dir,$VC_r) = @_;
507
508  my $res = 1;
509  if (getSVNEntries($dir,%$VC_r)==0) {
510    if (getCVSEntries($dir,%$VC_r)==0) {
511      $VC = '<no VC>';
512      $res = 0;
513    }
514    else {
515      $VC = 'CVS';
516    }
517  }
518  else {
519    $VC = 'SVN';
520  }
521
522  if (0) {
523    print "$VC entries for $dir:\n";
524    foreach (sort keys %$VC_r) {
525      print " ".$$VC_r{$_}.": $_\n";
526    }
527  }
528
529  return $res;
530}
531
532# ------------------------------------------------------------
533
534sub expectVCmember($$\%) {
535  my ($full,$item,$VC_r) = @_;
536  if ((not defined $$VC_r{$item}) and ($ignore_unknown==0)) {
537    if (not matchingExpr($full,@pack_fullGenerated)) {
538      die "'$full' ($_) included, but not in $VC (seems to be generated)";
539    }
540  }
541}
542
543my %unpackedCVSmember = map { $_ => 1; } (
544                                          '.cvsignore',
545                                          'ChangeLog',
546                                         );
547
548sub unexpectVCmember($$\%) {
549  my ($full,$item,$VC_r) = @_;
550  if (defined $$VC_r{$item}) {
551    if ((not exists $unpackedCVSmember{$item}) and ($ignore_unknown==0)) {
552      die "'$full' excluded, but in $VC";
553    }
554  }
555}
556
557sub is_version_controlled($\%) {
558  my ($item,$VC_r) = @_;
559  if (defined $$VC_r{$item}) {
560    return 1;
561  }
562  return 0;
563}
564
565sub saveAsInSVNforDir($) {
566  my ($dir) = @_;
567  foreach my $reg (@strictly_as_in_svn_when_matchesDir) {
568    if ($dir =~ $reg) {
569      return 1;
570    }
571  }
572  return 0;
573}
574
575sub dumpFiles($);
576sub dumpFiles($) {
577  my ($dir) = @_;
578
579  eval {
580    my @subdirs;
581    my @files;
582
583    my %CVS;
584    if (!getVCEntries($dir,%CVS)) {
585      die "arb_srclst.pl only works in a SVN checkout";
586    }
587
588    my $as_in_svn = saveAsInSVNforDir($dir);
589
590    opendir(DIR,$dir) || die "can't read directory '$dir' (Reason: $!)";
591    foreach (readdir(DIR)) {
592      if ($_ ne '.' and $_ ne '..') {
593        my $full = $dir.'/'.$_;
594
595        # print STDERR "full='$full' (as_in_svn=$as_in_svn)\n";
596
597        if (not -l $full) {
598          if (-d $full) {
599            if ($as_in_svn==1) {
600              if (is_version_controlled($_,%CVS)==1) {
601                push @subdirs, $full;
602              }
603            }
604            else {
605              if (useDir($full)==1) {
606                expectVCmember($full,$_,%CVS);
607                push @subdirs, $full;
608              }
609              else { unexpectVCmember($full,$_,%CVS); }
610            }
611          }
612          elsif (-f $full) {
613            if ($as_in_svn==1) {
614              if (is_version_controlled($_,%CVS)==1) {
615                push @files, $full;
616              }
617            }
618            else {
619              if (useFile($dir,$_)==1) {
620                expectVCmember($full,$_,%CVS);
621                push @files, $full;
622              }
623              else { unexpectVCmember($full,$_,%CVS); }
624            }
625          }
626          else { die "Unknown (neighter link nor file nor directory): '$full'"; }
627        }
628      }
629    }
630    closedir(DIR);
631
632    foreach (@files) { print $_."\n"; }
633    foreach (@subdirs) { dumpFiles($_); }
634  };
635  if ($@) {
636    my $err = $@;
637    if ($err =~ /at\s(.*\.pl)\sline\s([0-9]+)/) {
638      $err = "$1:$2: Error: $`";
639    }
640    $err =~ s/\n//g;
641    die "$err\n";
642  }
643}
644
645my $args = scalar(@ARGV);
646if ($args==0) {
647  dumpFiles('.');
648}
649else {
650  my $arg = $ARGV[0];
651  if ($arg eq 'ignore') {
652    $ignore_unknown = 1;
653    dumpFiles('.');
654  }
655  elsif ($arg eq 'matching') {
656    $debug_matching = 1;
657    dumpFiles('.');
658  }
659  else {
660    die "Usage: arb_srclst.pl [ignore|matching]\n";
661  }
662}
Note: See TracBrowser for help on using the repository browser.