~ubuntu-branches/debian/jessie/arb/jessie

« back to all changes in this revision

Viewing changes to SOURCE_TOOLS/tabBrake.pl

  • Committer: Package Import Robot
  • Author(s): Elmar Pruesse, Andreas Tille, Elmar Pruesse
  • Date: 2014-09-02 15:15:06 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20140902151506-jihq58b3iz342wif
Tags: 6.0.2-1
[ Andreas Tille ]
* New upstream version
  Closes: #741890
* debian/upstream -> debian/upstream/metadata
* debian/control:
   - Build-Depends: added libglib2.0-dev
   - Depends: added mafft, mrbayes
* debian/rules
   - Add explicite --remove-section=.comment option to manual strip call
* cme fix dpkg-control
* arb-common.dirs: Do not create unneeded lintian dir
* Add turkish debconf translation (thanks for the patch to Mert Dirik
  <mertdirik@gmail.com>)
  Closes: #757497

[ Elmar Pruesse ]
* patches removed:
   - 10_config.makefiles.patch,
     80_no_GL.patch
       removed in favor of creating file from config.makefile.template via 
       sed in debian/control
   - 20_Makefile_main.patch
       merged upstream
   - 21_Makefiles.patch
       no longer needed
   - 30_tmpfile_CVE-2008-5378.patch: 
       merged upstream
   - 50_fix_gcc-4.8.patch:
       merged upstream
   - 40_add_libGLU.patch:
       libGLU not needed for arb_ntree)
   - 60_use_debian_packaged_raxml.patch:
       merged upstream
   - 70_hardening.patch
       merged upstream
   - 72_add_math_lib_to_linker.patch
       does not appear to be needed
* patches added:
   - 10_upstream_r12793__show_db_load_progress:
       backported patch showing progress while ARB is loading a database
       (needed as indicator/splash screen while ARB is launching)
   - 20_upstream_r12794__socket_permissions:
       backported security fix
   - 30_upstream_r12814__desktop_keywords:
       backported add keywords to desktop (fixes lintian warning)
   - 40_upstream_r12815__lintian_spelling:
       backported fix for lintian reported spelling errors
   - 50_private_nameservers
       change configuration to put nameservers into users home dirs
       (avoids need for shared writeable directory)
   - 60_use_debian_phyml
       use phyml from debian package for both interfaces in ARB
* debian/rules:
   - create config.makefile from override_dh_configure target
   - use "make tarfile" in override_dh_install
   - remove extra cleaning not needed for ARB 6
   - use "dh_install --list-missing" to avoid missing files
   - added override_dh_fixperms target
* debian/control:
   - added libarb-dev package
   - Depends: added phyml, xdg-utils
   - Suggests: removed phyml
   - fix lintian duplicate-short-description (new descriptions)
* debian/*.install:
   - "unrolled" confusing globbing to select files
   - pick files from debian/tmp
   - moved all config files to /etc/arb
* debian/arb-common.templates: updated
* scripts:
   - removed arb-add-pt-server
   - launch-wrapper: 
     - only add demo.arb to newly created $ARBUSERDATA
     - pass commandline arguments through bin/arb wrapper
   - preinst: removing old PT server index files on upgrade from 5.5*
   - postinst: set setgid on shared PT dir
* rewrote arb.1 manfile
* added file icon for ARB databases
* using upstream arb_tcp.dat

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
use strict;
10
10
use warnings;
11
11
 
12
 
my $forceAll = 0; # 1 -> force scan of all files if no stamp, 0 -> assume all ok, scan only new files
 
12
my $forceAll  = 0; # 1 -> force scan of all files if no stamp, 0 -> assume all ok, scan only new files
 
13
my $defsStart = 15; # lineno of start of definition
 
14
 
 
15
my $checkForOldLogs = 1; # whether to check for old logfile and delete them
13
16
 
14
17
my %scan_extension = map { $_ => 1; } (
15
 
                                       'c', 'h', 
 
18
                                       'c', 'h',
16
19
                                       'cxx', 'hxx',
17
20
                                       'cpp', 'hpp',
18
21
                                       'f', 'inc',
49
52
                                         'exists', 'ignore', '3pm',
50
53
                                         'arb', 'seq', 'genmenu',
51
54
                                         'init', 'cvsignore', 'log', 'am', 'org',
52
 
                                         'last_gcc', 'csv',
 
55
                                         'last_gcc', 'last_compiler', 'csv',
53
56
                                         'b', 'n', 'helpfiles', 
54
57
                                         'ms', 'gon', 'pep', 'bla', 'tct', 'comm',
55
58
                                         'before', 'v1', 'data', 'pdb', 'embl', 'xpm', 'big',
58
61
                                        );
59
62
 
60
63
my %ignored_subdirs = map { $_ => 1; } (
61
 
                                        'GDE/CLUSTAL',
62
 
                                        'GDE/CLUSTALW',
63
 
                                        'GDE/FASTDNAML',
64
 
                                        'GDE/AxML',
65
 
                                        'GDE/TREEPUZZLE',
66
 
                                        'GDE/PHYML',
67
 
                                        'GDE/RAxML',
68
 
                                        'GDE/SUPPORT',
69
 
                                        'GDE/PHYLIP',
 
64
                                        'GDE',
 
65
                                        'READSEQ',
 
66
                                        'HEADERLIBS',
70
67
                                        'patches',
 
68
                                        'UNIT_TESTER/flags',
 
69
                                        'UNIT_TESTER/logs',
 
70
                                        'UNIT_TESTER/run',
 
71
                                        'UNIT_TESTER/sockets',
 
72
                                        'UNIT_TESTER/tests',
 
73
                                        'UNIT_TESTER/valgrind',
71
74
                                        'bin',
72
75
                                       );
73
76
 
 
77
my %ignored_relpath = map { $_ => 1; } (
 
78
                                        'NAMES_COM/names_client.h',
 
79
                                        'NAMES_COM/names_server.h',
 
80
                                        'PROBE_COM/PT_com.h',
 
81
                                        'PROBE_COM/PT_server.h',
 
82
                                       );
 
83
 
74
84
my $tab_count        = 0;
75
85
my $files_newer_than = 0;
76
86
 
104
114
  my ($dir,$basedir) = @_;
105
115
 
106
116
  my @subdirs = ();
 
117
  my $subdir  = '';
107
118
  if ($dir ne $basedir) {
108
 
    my $subdir = substr($dir,length($basedir)+1);
 
119
    $subdir = substr($dir,length($basedir)+1);
109
120
    if (defined $ignored_subdirs{$subdir}) {
110
121
      # print "Ignoring '$subdir' (dir='$dir')\n";
111
122
      return;
116
127
  foreach (readdir(DIR)) {
117
128
    if ($_ ne '.' and $_ ne '..') {
118
129
      my $full = $dir.'/'.$_;
 
130
      my $rel  = $subdir.'/'.$_;
119
131
      if (-l $full) {
120
132
        # print "$full:0: link -- skipped\n";
121
133
      }
136
148
        my $modtime   = getModtime($full);
137
149
 
138
150
        if ($modtime<$files_newer_than) {
 
151
          # file was created before last run of tabBrake.pl
139
152
          $scan = 0;
140
 
          # file was created before last compile start
 
153
 
141
154
          # check if it's a log from an aborted compile
142
155
          if (/^[^.]+\.([0-9]+)\.log$/o) {
143
 
            print "Old log file: $full -- removing\n";
144
 
            unlink($full) || print "$full:0: can't unlink (Reason: $!)\n";
 
156
            if ($checkForOldLogs and $modtime<($files_newer_than-3*60)) {
 
157
              print "Old log file: $full -- removing\n";
 
158
              unlink($full) || print "$full:0: can't unlink (Reason: $!)\n";
 
159
            }
145
160
          }
146
161
        }
 
162
        elsif (defined $ignored_relpath{$rel}) {
 
163
          # print "$full:0: excluded by relpath '$rel'\n";
 
164
          $scan = 0;
 
165
        }
147
166
        else {
148
167
          if (/\.([^.]+)$/) {   # file with extension
149
168
            my $ext = $1;
247
266
  die "'ARBHOME' not defined";
248
267
}
249
268
 
250
 
my $time_stamp = $ARBHOME.'/SOURCE_TOOLS/tabBrake.stamp';
 
269
my $time_stamp = $ARBHOME.'/SOURCE_TOOLS/stamp.tabBrake';
251
270
my $exitcode   = 0;
252
271
if (-f $time_stamp) {
253
272
  $files_newer_than = getModtime($time_stamp);
261
280
  else {
262
281
    print "Initial call - assuming everything is TAB-free\n";
263
282
    $files_newer_than = time;
 
283
    $checkForOldLogs  = 0; # do not check for old logs (sometimes fails on fresh checkouts, e.g. in jenkins build server)
264
284
  }
265
285
}
266
286
 
269
289
  # i.e. user inserts TAB to file -> fail once
270
290
}
271
291
recurse_dirs($ARBHOME,$ARBHOME);
272
 
if ($tab_count>0) { $exitcode = 1; }
 
292
if ($tab_count>0) {
 
293
  $exitcode = 1;
 
294
  print $ARBHOME.'/SOURCE_TOOLS/tabBrake.pl:'.$defsStart.': Warning: what may contain TABs is defined here'."\n";
 
295
}
273
296
 
274
297
exit($exitcode);