Fw: JROBINSON grant report, #13

"H.Merijn Brand" <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.sybase.devel
Message-ID <[email protected]>

Begin forwarded message:

Date: Tue, 18 Dec 2012 12:20:47 -0000
From: "Jess Robinson" <[email protected]>
To: [email protected]
Subject: Re: JROBINSON grant report, #13


On Tue, 18 Dec 2012 11:48:51 -0000, Jess Robinson  
<[email protected]> wrote:

> diff -ru ./lib/DBI/DBD.pm  
> /usr/src/perl/perl-cross-compile/repo/perl/cpan/DBI/lib/DBI/DBD.pm
> --- ./lib/DBI/DBD.pm	2012-02-04 20:51:40.000000000 +0000
> +++  
> /usr/src/perl/perl-cross-compile/repo/perl/cpan/DBI/lib/DBI/DBD.pm	2012-12-16  
> 15:11:29.000000000 +0000
> @@ -3283,7 +3283,7 @@
>
>   BEGIN {
>       $is_dbi = (-r 'DBI.pm' && -r 'DBI.xs' && -r 'DBIXS.h');
> -    require DBI unless $is_dbi;
> +    require DBI unless $is_dbi or $ENV{PERL_CORE};
>   }
>
>   my $done_inst_checks;
> @@ -3437,13 +3437,27 @@
>   sub dbd_dbi_arch_dir {
>       _inst_checks();
>       return '$(INST_ARCHAUTODIR)' if $is_dbi;
> -    my $dbidir = dbd_dbi_dir();
>       my %seen;
> +    my $dbi_version = '';
> +    if($ENV{PERL_CORE}) {
> +        ## also if($Config{usecrosscompile}) ? - cant load DBI as built  
> for other arch.
> +        my $updir = File::Spec->updir;
> +        my $CORElibdir = File::Spec->catdir(($updir) x 2, 'lib');
> +        my $DBI_pm = File::Spec->catfile($CORElibdir, 'DBI.pm');
> +        my $autoDBIdir = File::Spec->catdir($CORElibdir, 'auto', 'DBI');
> +        if(!-d $autoDBIdir) {
> +            die "Running under PERL_CORE, can't find $autoDBIdir";
> +        }
> +        $dbi_version = ExtUtils::MM_Unix->parse_version($DBI_pm);
> +    } else {
> +        $dbi_version = $DBI::VERSION;
> +    }
>       my @try = grep { not $seen{$_}++ } map { vmsify( unixify($_) .  
> "/auto/DBI/" ) } @INC;
>       my @xst = grep { -f vmsify( unixify($_) . "/Driver.xst" ) } @try;
>       Carp::croak("Unable to locate Driver.xst in @try") unless @xst;
>       Carp::carp( "Multiple copies of Driver.xst found in: @xst") if  
> @xst > 1;
> -    print "Using DBI $DBI::VERSION (for perl $] on $Config{archname})  
> installed in $xst[0]\n";
> +    print "Using DBI $dbi_version (for perl $] on $Config{archname})  
> installed in $xst[0]\n";
>       return File::Spec->canonpath($xst[0]);
>   }
>
> Looking at the above I've just realised I failed to change actual  
> finding of Driver.xst somewhere other than @INC, no wonder I had issues  
> with the actual building... I'll go fix that now!
>

Oops, nope, I was wrong. Somehow my brain read %INC not @INC, so this  
locating of Driver.xst does work without changes.

Jess


-- 
H.Merijn Brand  http://tux.nl   Perl Monger  http://amsterdam.pm.org/
using perl5.00307 .. 5.17   porting perl5 on HP-UX, AIX, and openSUSE
http://mirrors.develooper.com/hpux/        http://www.test-smoke.org/
http://qa.perl.org   http://www.goldmark.org/jeff/stupid-disclaimers/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.