1 # -*- Mode: perl; indent-tabs-mode: nil -*-
3 # The contents of this file are subject to the Mozilla Public
4 # License Version 1.1 (the "License"); you may not use this file
5 # except in compliance with the License. You may obtain a copy of
6 # the License at http://www.mozilla.org/MPL/
8 # Software distributed under the License is distributed on an "AS
9 # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
10 # implied. See the License for the specific language governing
11 # rights and limitations under the License.
13 # The Original Code are the Bugzilla Tests.
15 # The Initial Developer of the Original Code is Zach Lipton
16 # Portions created by Zach Lipton are
17 # Copyright (C) 2001 Zach Lipton. All
20 # Contributor(s): Zach Lipton <zach@zachlipton.com>
21 # Joel Peshkin <bugreport@peshkin.net>
24 package Support::Files;
28 # exclude_deps is a hash of arrays listing the files to be excluded
29 # if a module is not available
31 @additional_files = ();
33 'XML::Twig' => ['importxml.pl'],
34 'Net::LDAP' => ['Bugzilla/Auth/Verify/LDAP.pm'],
35 'Email::Reply' => ['email_in.pl'],
36 'Email::MIME::Attachment::Stripper' => ['email_in.pl']
41 find(sub { push(@files, $File::Find::name) if $_ =~ /\.pm$/;}, 'SL');
42 find(sub { push(@files, $File::Find::name) if $_ =~ /\.pl$/;}, qw(bin/mozilla sql/Pg-upgrade2));
43 find(sub { push(@files, $File::Find::name) if $_ =~ /\.html$/;}, qw(templates/webpages));
47 my ($msg, $vnum, $vstr);
49 eval { my $p; ($p = $pkg . ".pm") =~ s!::!/!g; require $p; };
54 foreach $dep (keys(%exclude_deps)) {
55 if (!have_pkg($dep)) {
56 push @exclude_files, @{$exclude_deps{$dep}};
63 foreach $exclude (@exclude_files) {
64 if ($file eq $exclude) { return undef; } # get rid of excluded files.
67 if ($file =~ /\.cgi$|\.pl$|\.pm$/) {
71 foreach $additional (@additional_files) {
72 if ($file eq $additional) { return 1; }
77 foreach $currentfile (@files) {
78 if (isTestingFile($currentfile)) {
79 push(@testitems,$currentfile);