Bring back _TempExtlib (d0435d75), this time for Sub::Quote
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / StartupCheck.pm
index 30bc51f..986e452 100644 (file)
@@ -1,5 +1,42 @@
 package DBIx::Class::StartupCheck;
 
+# Temporary - tempextlib
+use warnings;
+use strict;
+use namespace::clean;
+BEGIN {
+  # 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"
+        . "\n\tThis *WILL NOT* be necessary for the official DBIC release\n\n"
+      ;
+    }
+  }
+
+  require File::Spec;
+  our ($HERE) = File::Spec->rel2abs(
+    File::Spec->catdir( (File::Spec->splitpath(__FILE__))[1], '_TempExtlib' )
+  ) =~ /^(.*)$/; # screw you, taint mode
+
+  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
@@ -17,7 +54,7 @@ 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<t/99rh_perl_perf_bug.t> and further information about the bug has been
-put in L<DBIx::Class::Manual::Troubleshooting>
+put in L<DBIx::Class::Manual::Troubleshooting>.
 
 Other checks may be added from time to time.
 
@@ -27,22 +64,13 @@ 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 FURTHER QUESTIONS?
 
-Matt S. Trout
+Check the list of L<additional DBIC resources|DBIx::Class/GETTING HELP/SUPPORT>.
 
-=head1 AUTHOR
+=head1 COPYRIGHT AND LICENSE
 
-Jon Schutz
-
-=head1 LICENSE
-
-You may distribute this code under the same terms as Perl itself.
-
-=cut
-
-1;
+This module is free software L<copyright|DBIx::Class/COPYRIGHT AND LICENSE>
+by the L<DBIx::Class (DBIC) authors|DBIx::Class/AUTHORS>. You can
+redistribute it and/or modify it under the same terms as the
+L<DBIx::Class library|DBIx::Class/COPYRIGHT AND LICENSE>.