Author: turnstep
Date: Tue Feb 19 18:55:08 2008
New Revision: 10806

Modified:
   DBD-Pg/trunk/Changes
   DBD-Pg/trunk/Makefile.PL

Log:
Check for invalid ENVs, helps prevent nasty and confusing compiler errors, by 
not getting to that point. :)


Modified: DBD-Pg/trunk/Changes
==============================================================================
--- DBD-Pg/trunk/Changes        (original)
+++ DBD-Pg/trunk/Changes        Tue Feb 19 18:55:08 2008
@@ -4,6 +4,12 @@
 
        - Introduced enhanced trace flags [GSM]
 
+2.1.2 Released February 19, 2008
+
+       - Do not build if environment variables POSTGRES_HOME, POSTGRES_LIB, 
+               or POSTGRES_INCLUDE are set but not valid.
+       - Fix dependency requirements, especially version.pm
+
 2.1.1
 
        - Better URLs to cpan.org resources.

Modified: DBD-Pg/trunk/Makefile.PL
==============================================================================
--- DBD-Pg/trunk/Makefile.PL    (original)
+++ DBD-Pg/trunk/Makefile.PL    Tue Feb 19 18:55:08 2008
@@ -6,7 +6,7 @@
 use warnings;
 use 5.006001;
 
-use version; my $VERSION = qv('2.1.1_1');
+use version; my $VERSION = qv('2.1.2');
 
 my $lib;
 BEGIN {
@@ -61,6 +61,20 @@
 print "POSTGRES_LIB: $showlib\n";
 print "OS: $os\n";
 
+my $baddir;
+for my $d (qw/HOME INCLUDE LIB/) {
+       next if ! exists $ENV{"POSTGRES_$d"};
+       if (! -d $ENV{"POSTGRES_$d"}) {
+               printf "The environment variable %s points to a non-existent 
directory: %s\n",
+                       "POSTGRES_$d", $ENV{"POSTGRES_$d"};
+               $baddir++;
+       }
+}
+if ($baddir) {
+       print "Cannot build unless the directories exist, exiting.\n";
+       exit 0;
+}
+
 if ($serverversion < 11) {
        print "Could not determine the PostgreSQL library version.\n".
                "Please ensure that a valid path is given to the 'pg_config' 
command,\n".

Reply via email to