RSS

(root)/bugzilla/4.0 : 5304 : importxml.pl

To get this branch, use:
bzr branch /bugzilla/4.0

« back to all changes in this revision

Viewing changes to importxml.pl

mkanat%bugzilla.org
2007-10-19 04:46:10
Revision ID: cvs-1:mkanatbugzilla.org-20071019114610-33dgtz2p2zfawdch
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

Show diffs side-by-side

added added

removed removed

54
54
#
55
55
#####################################################################
56
56
 
57
 
# figure out which path this script lives in. Set the current path to
58
 
# this and add it to @INC so this will work when run as part of mail
59
 
# alias by the mailer daemon
60
 
# since "use lib" is run at compile time, we need to enclose the
61
 
# $::path declaration in a BEGIN block so that it is executed before
62
 
# the rest of the file is compiled.
 
57
use File::Basename qw(dirname);
 
58
# MTAs may call this script from any directory, but it should always
 
59
# run from this one so that it can find its modules.
63
60
BEGIN {
64
 
    $::path = $0;
65
 
    $::path =~ m#(.*)/[^/]+#;
66
 
    $::path = $1;
67
 
    $::path ||= '.';    # $0 is empty at compile time.  This line will
68
 
                        # have no effect on this script at runtime.
 
61
    require File::Basename;
 
62
    my $dir = $0; $dir =~ /(.*)/; $dir = $1; # trick taint
 
63
    chdir(File::Basename::dirname($dir));
69
64
}
70
65
 
71
 
chdir $::path;
72
 
use lib ($::path);
 
66
use lib qw(. lib);
73
67
# Data dumber is used for debugging, I got tired of copying it back in 
74
68
# and then removing it. 
75
69
#use Data::Dumper;

Loggerhead 1.18.1 is a web-based interface for Bazaar branches