Commit | Line | Data |
11736b4c |
1 | package DBIx::Class::StartupCheck; |
2 | |
b46b8537 |
3 | # Temporary - tempextlib |
4 | use warnings; |
5 | use strict; |
6 | use namespace::clean; |
7 | BEGIN { |
8 | # There can be only one of these, make sure we get the bundled part and |
9 | # *not* something off the site lib |
10 | for (qw( |
11 | Sub::Quote |
12 | )) { |
13 | (my $incfn = "$_.pm") =~ s|::|/|g; |
14 | |
15 | if ($INC{$incfn}) { |
16 | die "\n\t*TEMPORARY* TRIAL RELEASE REQUIREMENTS VIOLATED\n\n" |
17 | . "Unable to continue - a part of the bundled templib contents " |
18 | . "was already loaded (likely an older version from CPAN). " |
19 | . "Make sure that @{[ __PACKAGE__ ]} is loaded before $_\n" |
95b76469 |
20 | . "\nUsually it is sufficient to add PERL5OPT=\"-M@{[ __PACKAGE__ ]}\" " |
21 | . "to your environment in order to resolve this problem\n" |
22 | . "\n\tThis is temporary and *WILL NOT* be necessary for the official " |
23 | . "DBIC release\n\n" |
b46b8537 |
24 | ; |
25 | } |
26 | } |
27 | |
28 | require File::Spec; |
29 | our ($HERE) = File::Spec->rel2abs( |
30 | File::Spec->catdir( (File::Spec->splitpath(__FILE__))[1], '_TempExtlib' ) |
31 | ) =~ /^(.*)$/; # screw you, taint mode |
32 | |
33 | die "TempExtlib $HERE does not seem to exist - perhaps you need to run `perl Makefile.PL` in the DBIC checkout?\n" |
34 | unless -d $HERE; |
35 | |
36 | unshift @INC, $HERE; |
37 | } |
38 | |
a2bd3796 |
39 | 1; |
40 | |
41 | __END__ |
42 | |
11736b4c |
43 | =head1 NAME |
44 | |
45 | DBIx::Class::StartupCheck - Run environment checks on startup |
46 | |
47 | =head1 SYNOPSIS |
48 | |
49 | use DBIx::Class::StartupCheck; |
d4daee7b |
50 | |
11736b4c |
51 | =head1 DESCRIPTION |
52 | |
dc253b77 |
53 | This module used to check for, and if necessary issue a warning for, a |
54 | particular bug found on Red Hat and Fedora systems using their system |
55 | perl build. As of September 2008 there are fixed versions of perl for |
56 | all current Red Hat and Fedora distributions, but the old check still |
57 | triggers, incorrectly flagging those versions of perl to be buggy. A |
58 | more comprehensive check has been moved into the test suite in |
59 | C<t/99rh_perl_perf_bug.t> and further information about the bug has been |
48580715 |
60 | put in L<DBIx::Class::Manual::Troubleshooting>. |
dc253b77 |
61 | |
62 | Other checks may be added from time to time. |
11736b4c |
63 | |
64 | Any checks herein can be disabled by setting an appropriate environment |
dc253b77 |
65 | variable. If your system suffers from a particular bug, you will get a |
66 | warning message on startup sent to STDERR, explaining what to do about |
67 | it and how to suppress the message. If you don't see any messages, you |
68 | have nothing to worry about. |
11736b4c |
69 | |
a2bd3796 |
70 | =head1 FURTHER QUESTIONS? |
11736b4c |
71 | |
a2bd3796 |
72 | Check the list of L<additional DBIC resources|DBIx::Class/GETTING HELP/SUPPORT>. |
11736b4c |
73 | |
a2bd3796 |
74 | =head1 COPYRIGHT AND LICENSE |
11736b4c |
75 | |
a2bd3796 |
76 | This module is free software L<copyright|DBIx::Class/COPYRIGHT AND LICENSE> |
77 | by the L<DBIx::Class (DBIC) authors|DBIx::Class/AUTHORS>. You can |
78 | redistribute it and/or modify it under the same terms as the |
79 | L<DBIx::Class library|DBIx::Class/COPYRIGHT AND LICENSE>. |