~ubuntu-branches/ubuntu/maverick/openldap/maverick-proposed

« back to all changes in this revision

Viewing changes to debian/tests/find_unused_functions

  • Committer: Bazaar Package Importer
  • Author(s): Steve Langasek, Russ Allbery, Steve Langasek
  • Date: 2008-10-11 01:53:55 UTC
  • mto: (0.3.1 squeeze)
  • mto: This revision was merged to the branch mainline in revision 11.
  • Revision ID: james.westby@ubuntu.com-20081011015355-5iazff47eui9nypc
Tags: 2.4.11-1
* New upstream version (closes: #499560).
  - Fixes a crash with syncrepl and delcsn (closes: #491066).
  - Fix CRL handling with GnuTLS (closes: #498410).
  - Drop patches no_backend_inter-linking,
    CVE-2008-2952_BER-decoding-assertion, and gnutls-ssf, applied
    upstream.

[ Russ Allbery ]
* New patch, back-perl-init, which updates the calling conventions
  around initialization and shutdown of the Perl interpreter to match
  the current perlembed recommendations.  Fixes probable hangs on HPPA
  in back-perl.  Thanks, Niko Tyni.  (Closes: #495069)

[ Steve Langasek ]
* Drop the conflict with libldap2, which is not the standard means of
  handling symbol conflicts in Debian and which causes serious upgrade
  problems from etch.  Closes: #487211.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /usr/bin/perl -w
 
2
 
 
3
use autouse Data::Dumper, qw{Dumper};
 
4
 
 
5
# Script to find the unused shell functions in slapd.scripts-common
 
6
 
 
7
our @code;
 
8
 
 
9
# Get all shell code from maintainer scripts
 
10
 
 
11
foreach my $file ((<slapd.*rm>, <slapd.*inst>, <slapd.config>, 
 
12
        <slapd.scripts-common>)) {
 
13
        open SCRIPT, "<$file" or
 
14
                die "Can't open $file: $!";
 
15
        push @code, <SCRIPT>;
 
16
        close SCRIPT;
 
17
}
 
18
 
 
19
# Find all function declarations
 
20
 
 
21
our @functions = map { /^(\w+)\s*\(\).*$/;  } @code;
 
22
 
 
23
# Find unused functions
 
24
 
 
25
foreach $function (@functions) {
 
26
        @occurences  = grep /$function/, @code;
 
27
        @invocations = grep { !/^$function\s*\(\)/ and !/#.*$function/ }
 
28
                                @occurences;
 
29
        print "$function\n" if @invocations == 0;
 
30
}