Commit 415e32d4 authored by mkanat%bugzilla.org's avatar mkanat%bugzilla.org

Bug 399954: Make Bugzilla able to hold its dependencies in a local directory

Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=LpSolit
parent c6ede85f
......@@ -22,7 +22,6 @@
# A. Karl Kornel <karl@kornel.name>
use strict;
use lib ".";
# This module represents a chart.
#
......
......@@ -445,6 +445,7 @@ sub bz_locations {
# That means that if you modify these paths, they must be absolute paths.
return {
'libpath' => $libpath,
'ext_libpath' => "$libpath/lib",
# If you put the libraries in a different location than the CGIs,
# make sure this still points to the CGIs.
'cgi_path' => $libpath,
......
......@@ -62,6 +62,7 @@ sub FILESYSTEM {
my $webdotdir = bz_locations()->{'webdotdir'};
my $templatedir = bz_locations()->{'templatedir'};
my $libdir = bz_locations()->{'libpath'};
my $extlib = bz_locations()->{'ext_libpath'};
my $skinsdir = bz_locations()->{'skinsdir'};
my $ws_group = Bugzilla->localconfig->{'webservergroup'};
......@@ -152,6 +153,8 @@ sub FILESYSTEM {
dirs => $ws_dir_readable },
"$libdir/Bugzilla" => { files => $ws_readable,
dirs => $ws_dir_readable },
$extlib => { files => $ws_readable,
dirs => $ws_dir_readable },
$templatedir => { files => $ws_readable,
dirs => $ws_dir_readable },
images => { files => $ws_readable,
......@@ -251,6 +254,8 @@ EOT
contents => $ht_default_deny },
"$libdir/Bugzilla/.htaccess" => { perms => $ws_readable,
contents => $ht_default_deny },
"$extlib/.htaccess" => { perms => $ws_readable,
contents => $ht_default_deny },
"$templatedir/.htaccess" => { perms => $ws_readable,
contents => $ht_default_deny },
......
......@@ -21,7 +21,6 @@
# Lance Larsh <lance.larsh@oracle.com>
use strict;
use lib ".";
# This module implements a series - a set of data to be plotted on a chart.
#
......
......@@ -21,7 +21,7 @@
use strict;
use lib qw(.);
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
......
......@@ -35,7 +35,7 @@
# Make it harder for us to do dangerous things in Perl.
use strict;
use lib qw(.);
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
......
......@@ -32,7 +32,7 @@
# Make it harder for us to do dangerous things in Perl.
use strict;
use lib qw(.);
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
......
......@@ -43,7 +43,7 @@
# Offer subscription when you get a "series already exists" error?
use strict;
use lib qw(.);
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
......
......@@ -51,7 +51,7 @@ use POSIX qw(setlocale LC_CTYPE);
use Safe;
BEGIN { chdir dirname($0); }
use lib ".";
use lib qw(. lib);
use Bugzilla::Constants;
use Bugzilla::Install::Requirements;
use Bugzilla::Install::Util qw(install_string get_version_and_os);
......
......@@ -24,7 +24,7 @@
use strict;
use lib qw(.);
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
......
......@@ -34,7 +34,7 @@ use AnyDBM_File;
use strict;
use IO::Handle;
use lib ".";
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
......
......@@ -28,7 +28,7 @@
# Make it harder for us to do dangerous things in Perl.
use strict;
use lib qw(.);
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
......
......@@ -29,6 +29,7 @@ C<bz_webservice_demo.pl --help> for detailed help
=cut
use strict;
use lib qw(lib);
use Getopt::Long;
use Pod::Usage;
use File::Basename qw(dirname);
......
......@@ -19,7 +19,7 @@
# Contributor(s): Max Kanat-Alexander <mkanat@bugzilla.org>
use strict;
use lib ".";
use lib qw(. lib);
use Bugzilla;
use Bugzilla::DB;
use Bugzilla::Util;
......
......@@ -44,7 +44,7 @@ merge-users.pl - Merge two user accounts.
=cut
use lib qw(.);
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
......
......@@ -20,8 +20,7 @@
# Contributor(s): Max Kanat-Alexander <mkanat@bugzilla.org>
use strict;
# Allow the script to be run from contrib or as contrib/recode.pl
use lib '..';
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
......
......@@ -4,7 +4,7 @@
#
# Nick Barnes, Ravenbrook Limited, 2004-04-01.
#
# $Id: sendbugmail.pl,v 1.7 2006/07/03 21:42:47 mkanat%bugzilla.org Exp $
# $Id: sendbugmail.pl,v 1.8 2007/10/19 06:46:17 mkanat%bugzilla.org Exp $
#
# Bugzilla email script for Bugzilla 2.17.4 and later. Invoke this to send
# bugmail for a bug which has been changed directly in the database.
......@@ -14,7 +14,7 @@
#
# Usage: perl -T contrib/sendbugmail.pl bug_id user_email
use lib qw(.);
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Util;
......
......@@ -23,7 +23,7 @@
use strict;
use lib qw(.);
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
......
......@@ -22,7 +22,7 @@
use strict;
use lib qw(.);
use lib qw(. lib);
use Net::LDAP;
use Bugzilla;
......
......@@ -26,7 +26,7 @@
use strict;
use lib qw(.);
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
......
......@@ -23,7 +23,7 @@
# Frédéric Buclin <LpSolit@gmail.com>
use strict;
use lib qw(.);
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
......
......@@ -22,7 +22,7 @@
# Contributor(s): Gervase Markham <gerv@gerv.net>
use strict;
use lib ".";
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Error;
......
......@@ -34,7 +34,7 @@ BEGIN {
chdir dirname($0);
}
use lib qw(.. lib);
use lib qw(.. ../lib lib);
# We only compile our POD if Pod::Simple is installed. We do the checks
# this way so that if there's a compile error in Pod::Simple::HTML::Bugzilla,
......
<!-- <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"> -->
<!-- $Id: installation.xml,v 1.146 2007/10/16 09:56:07 justdave%bugzilla.org Exp $ -->
<!-- $Id: installation.xml,v 1.147 2007/10/19 06:46:18 mkanat%bugzilla.org Exp $ -->
<chapter id="installing-bugzilla">
<title>Installing Bugzilla</title>
......@@ -1123,7 +1123,7 @@
</warning>
<programlisting>
PerlSwitches -I/var/www/html/bugzilla -w -T
PerlSwitches -I/var/www/html/bugzilla -I/var/www/html/bugzilla/lib -w -T
PerlConfigRequire /var/www/html/bugzilla/mod_perl.pl
</programlisting>
</step>
......
......@@ -27,7 +27,7 @@ use strict;
use AnyDBM_File;
use lib qw(.);
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
......
......@@ -21,7 +21,7 @@
# Direct any questions on this source code to mozilla.org
use strict;
use lib ".";
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
......
......@@ -24,7 +24,7 @@
# Akamai Technologies <bugzilla-dev@akamai.com>
use strict;
use lib ".";
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
......
......@@ -16,7 +16,7 @@
# Contributor(s): Frédéric Buclin <LpSolit@gmail.com>
use strict;
use lib ".";
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
......
......@@ -27,7 +27,7 @@
# Make it harder for us to do dangerous things in Perl.
use strict;
use lib ".";
use lib qw(. lib);
# Use Bugzilla's flag modules for handling flag types.
use Bugzilla;
......
......@@ -25,7 +25,7 @@
# Frédéric Buclin <LpSolit@gmail.com>
use strict;
use lib ".";
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
......
......@@ -21,7 +21,7 @@
# Contributor(s): Terry Weissman <terry@mozilla.org>
use strict;
use lib ".";
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
......
......@@ -16,7 +16,7 @@
#
use strict;
use lib ".";
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
......
......@@ -23,7 +23,7 @@
# Frédéric Buclin <LpSolit@gmail.com>
use strict;
use lib ".";
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
......
......@@ -32,7 +32,7 @@
# Holger Schurig <holgerschurig@nikocity.de>
use strict;
use lib ".";
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
......
......@@ -17,7 +17,7 @@
#
use strict;
use lib qw(.);
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
......
......@@ -21,7 +21,7 @@
# Gavin Shelley <bugzilla@chimpychompy.org>
use strict;
use lib ".";
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
......
......@@ -19,7 +19,7 @@
# with some cleanup.
use strict;
use lib ".";
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Util;
......
......@@ -29,7 +29,7 @@
# Holger Schurig <holgerschurig@nikocity.de>
use strict;
use lib ".";
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
......
......@@ -27,7 +27,7 @@
use strict;
use lib ".";
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
......
......@@ -21,7 +21,7 @@
use strict;
use lib qw(.);
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
......
......@@ -29,6 +29,8 @@ BEGIN {
chdir(File::Basename::dirname($0));
}
use lib qw(. lib);
use Data::Dumper;
use Email::Address;
use Email::Reply qw(reply);
......
......@@ -35,7 +35,7 @@
use strict;
use lib qw(.);
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
......
......@@ -54,22 +54,16 @@ use strict;
#
#####################################################################
# figure out which path this script lives in. Set the current path to
# this and add it to @INC so this will work when run as part of mail
# alias by the mailer daemon
# since "use lib" is run at compile time, we need to enclose the
# $::path declaration in a BEGIN block so that it is executed before
# the rest of the file is compiled.
use File::Basename qw(dirname);
# MTAs may call this script from any directory, but it should always
# run from this one so that it can find its modules.
BEGIN {
$::path = $0;
$::path =~ m#(.*)/[^/]+#;
$::path = $1;
$::path ||= '.'; # $0 is empty at compile time. This line will
# have no effect on this script at runtime.
require File::Basename;
my $dir = $0; $dir =~ /(.*)/; $dir = $1; # trick taint
chdir(File::Basename::dirname($dir));
}
chdir $::path;
use lib ($::path);
use lib qw(. lib);
# Data dumber is used for debugging, I got tired of copying it back in
# and then removing it.
#use Data::Dumper;
......
......@@ -29,7 +29,7 @@
use strict;
# Include the Bugzilla CGI and general utility library.
use lib ".";
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
......
This directory contains the Perl modules that Bugzilla requires to run.
If you would rather have Bugzilla use the Perl modules installed on your
system, you can delete everything in this directory.
......@@ -22,7 +22,7 @@
# Gervase Markham <gerv@gerv.net>
use strict;
use lib qw(.);
use lib qw(. lib);
use Bugzilla;
my $cgi = Bugzilla->cgi;
......
......@@ -30,7 +30,7 @@
use strict;
use lib ".";
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Error;
......
......@@ -25,7 +25,7 @@
# Marc Schumann <wurblzap@gmail.com>
use strict;
use lib qw(.);
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Attachment;
......
......@@ -43,7 +43,7 @@
use strict;
use lib qw(.);
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
......
......@@ -26,7 +26,7 @@
# Max Kanat-Alexander <mkanat@bugzilla.org>
use strict;
use lib ".";
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Bug;
......
......@@ -25,7 +25,7 @@
use strict;
use lib qw(.);
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
......
......@@ -23,7 +23,7 @@
# A. Karl Kornel <karl@kornel.name>
use strict;
use lib qw(.);
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Mailer;
......
......@@ -22,7 +22,7 @@
# <rdean@cambianetworks.com>
use strict;
use lib ".";
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
......
......@@ -37,7 +37,7 @@
use strict;
use lib qw(.);
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
......
......@@ -28,7 +28,7 @@
# Make it harder for us to do dangerous things in Perl.
use strict;
use lib qw(.);
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Util;
......
......@@ -23,6 +23,7 @@
# Make it harder for us to do dangerous things in Perl.
use diagnostics;
use strict;
use lib qw(lib);
use Test::Harness qw(&runtests $verbose);
......
......@@ -26,7 +26,7 @@
use strict;
use lib qw(.);
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
......
......@@ -21,7 +21,7 @@
use strict;
use lib qw(.);
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
......
......@@ -16,7 +16,7 @@
# Contributor(s): Frédéric Buclin <LpSolit@gmail.com>
use strict;
use lib ".";
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Error;
......
......@@ -24,7 +24,7 @@
use strict;
use lib qw(.);
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Error;
......
......@@ -22,7 +22,7 @@
use strict;
use lib qw(.);
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
......
......@@ -23,7 +23,7 @@
use strict;
use lib qw(.);
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Util;
......
......@@ -23,7 +23,7 @@
use strict;
use lib qw(.);
use lib qw(. lib);
use File::Temp;
......
......@@ -26,7 +26,7 @@
use strict;
use lib qw(.);
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Error;
......
......@@ -17,7 +17,7 @@
use strict;
use lib ".";
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Error;
......
......@@ -19,7 +19,7 @@
use strict;
use lib qw(.);
use lib qw(. lib);
use Date::Parse; # strptime
......
......@@ -19,7 +19,7 @@
# issues as possible.
use strict;
use lib ".";
use lib qw(. lib);
BEGIN {
my $envpath = $ENV{'PATH'};
......
......@@ -28,7 +28,7 @@
# Make it harder for us to do dangerous things in Perl.
use strict;
use lib qw(.);
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
......
......@@ -24,7 +24,7 @@
use strict;
use lib qw(.);
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
......
......@@ -25,7 +25,7 @@
# Frédéric Buclin <LpSolit@gmail.com>
use strict;
use lib ".";
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
......
......@@ -26,7 +26,7 @@
use strict;
use lib ".";
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
......
......@@ -29,7 +29,7 @@
# touched for more than the number of days specified in the whinedays param.
use strict;
use lib '.';
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Mailer;
......
......@@ -24,7 +24,7 @@
use strict;
use lib qw(.);
use lib qw(. lib);
use Bugzilla;
my $cgi = Bugzilla->cgi;
......
......@@ -16,7 +16,7 @@
# Contributor(s): Marc Schumann <wurblzap@gmail.com>
use strict;
use lib qw(.);
use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment