X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStartupCheck.pm;h=7a44a4baf21d6dfb6b19c730f0558f0b5cfd8c51;hb=7dc14bc09910cb750e5fe503dfa18a97eed490d1;hp=4710192d47a71ef58c135f14ea6579ee73eef784;hpb=11736b4c186bbc10c80f13fdb1eca80b1ff75711;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/StartupCheck.pm b/lib/DBIx/Class/StartupCheck.pm index 4710192..7a44a4b 100644 --- a/lib/DBIx/Class/StartupCheck.pm +++ b/lib/DBIx/Class/StartupCheck.pm @@ -1,34 +1,45 @@ package DBIx::Class::StartupCheck; +# Temporary - tempextlib +use warnings; +use strict; +use namespace::clean; BEGIN { - - { package TestRHBug; use overload bool => sub { 0 } } - - sub _has_bug_34925 { - my %thing; - my $r1 = \%thing; - my $r2 = \%thing; - bless $r1 => 'TestRHBug'; - return !!$r2; + # There can be only one of these, make sure we get the bundled part and + # *not* something off the site lib + for (qw( + Sub::Quote + )) { + (my $incfn = "$_.pm") =~ s|::|/|g; + + if ($INC{$incfn}) { + die "\n\t*TEMPORARY* TRIAL RELEASE REQUIREMENTS VIOLATED\n\n" + . "Unable to continue - a part of the bundled templib contents " + . "was already loaded (likely an older version from CPAN). " + . "Make sure that @{[ __PACKAGE__ ]} is loaded before $_\n" + . "\nUsually it is sufficient to add PERL5OPT=\"-M@{[ __PACKAGE__ ]}\" " + . "to your environment in order to resolve this problem\n" + . "\n\tThis is temporary and *WILL NOT* be necessary for the official " + . "DBIC release\n\n" + ; } + } - sub _possibly_has_bad_overload_performance { - return $] < 5.008009 && ! _has_bug_34925(); - } + require File::Spec; + our ($HERE) = File::Spec->rel2abs( + File::Spec->catdir( (File::Spec->splitpath(__FILE__))[1], '_TempExtlib' ) + ) =~ /^(.*)$/; # screw you, taint mode - unless ($ENV{DBIC_NO_WARN_BAD_PERL}) { - if (_possibly_has_bad_overload_performance()) { - print STDERR "\n\nWARNING: " . __PACKAGE__ . ": This version of Perl is likely to exhibit\n" . - "extremely slow performance for certain critical operations.\n" . - "Please consider recompiling Perl. For more information, see\n" . - "https://bugzilla.redhat.com/show_bug.cgi?id=196836 and/or\n" . - "http://lists.scsys.co.uk/pipermail/dbix-class/2007-October/005119.html.\n" . - "You can suppress this message by setting DBIC_NO_WARN_BAD_PERL=1 in your\n" . - "environment.\n\n"; - } - } + die "TempExtlib $HERE does not seem to exist - perhaps you need to run `perl Makefile.PL` in the DBIC checkout?\n" + unless -d $HERE; + + unshift @INC, $HERE; } +1; + +__END__ + =head1 NAME DBIx::Class::StartupCheck - Run environment checks on startup @@ -36,35 +47,33 @@ DBIx::Class::StartupCheck - Run environment checks on startup =head1 SYNOPSIS use DBIx::Class::StartupCheck; - -=head1 DESCRIPTION -Currently this module checks for, and if necessary issues a warning for, a -particular bug found on RedHat systems from perl-5.8.8-10 and up. Other checks -may be added from time to time. - -Any checks herein can be disabled by setting an appropriate environment -variable. If your system suffers from a particular bug, you will get a warning -message on startup sent to STDERR, explaining what to do about it and how to -suppress the message. If you don't see any messages, you have nothing to worry -about. - -=head1 CONTRIBUTORS - -Nigel Metheringham - -Brandon Black +=head1 DESCRIPTION -Matt S. Trout +This module used to check for, and if necessary issue a warning for, a +particular bug found on Red Hat and Fedora systems using their system +perl build. As of September 2008 there are fixed versions of perl for +all current Red Hat and Fedora distributions, but the old check still +triggers, incorrectly flagging those versions of perl to be buggy. A +more comprehensive check has been moved into the test suite in +C and further information about the bug has been +put in L. -=head1 AUTHOR +Other checks may be added from time to time. -Jon Schutz +Any checks herein can be disabled by setting an appropriate environment +variable. If your system suffers from a particular bug, you will get a +warning message on startup sent to STDERR, explaining what to do about +it and how to suppress the message. If you don't see any messages, you +have nothing to worry about. -=head1 LICENSE +=head1 FURTHER QUESTIONS? -You may distribute this code under the same terms as Perl itself. +Check the list of L. -=cut +=head1 COPYRIGHT AND LICENSE -1; +This module is free software L +by the L. You can +redistribute it and/or modify it under the same terms as the +L.