source: branches/stable/util/arb_srclst.pl

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