mpeppler/DBD-Sybase

Makefile.PL: avoid picking up libct_cu.so [rt.cpan.org #92442]

Closed this issue · 0 comments

Migrated from rt.cpan.org#92442 (status was 'open')

Requestors:

From https://www.google.com/accounts/o8/id?id=AItOawlVEP5IYeRHpH3ZT4ELVsJ3INWz0Lpegpo on 2014-01-24 17:56:19
:

Here's my situation:
* Linux server
* /usr/lib contains libct_cu.so
* /usr/lib64 contains libct.so & FreeTDS in general

configure() gets confused: it calls checkLib which checks /usr/lib for the existence of /libct|libsybct/i, which libct_cu.so satisfies. It then reports that /usr/lib contains FreeTDS.

Further down, we call getLibVersion, which greps /usr/lib more strictly, using /lib(syb)?ct(64)?\./ finding no SO file. It then crashes on the open(undef) call.

The patch unifies the two regular expressions, making them
* stricter so as not to match libct_cu
* case insensitive (because one of them was like that already; presumably due to Windows)

==== //depot/QA/Toolbox/main.br/CPAN/DBD-Sybase/1.15/src/Makefile.PL#7 - /ns/build/users/ferencis/0toolbox/main.br/CPAN/DBD-Sybase/1.15/src/Makefile.PL ====
--- /tmp/tmp.29302.57   2014-01-24 17:55:55.000000000 +0000
+++ /ns/build/users/ferencis/0toolbox/main.br/CPAN/DBD-Sybase/1.15/src/Makefile.PL      2014-01-24 17:55:10.000000000 +0000
@@ -19,6 +19,8 @@
 $LINKTYPE         = 'dynamic';
 $written_pwd_file = 'PWD';

+my $libct_re = qr/\blib(syb)?ct(64)?\./i;
+
 my $file;
 my $chained;
 my $threaded_libs;
@@ -342,7 +344,7 @@
        opendir( DIR, $lib );

        # reverse to pick up libsybct before libct...
-       my @files = reverse( grep( /lib(syb)?ct(64)?\./, readdir(DIR) ) );
+       my @files = reverse( grep( $libct_re, readdir(DIR) ) );
        closedir(DIR);
        my $file;
        foreach (@files) {
@@ -410,7 +412,7 @@
        my $dir = shift;

        opendir( DIR, $dir ) || die "Can't access $dir: $!";
-       my @files = grep( /libct|libsybct/i, readdir(DIR) );
+       my @files = grep( $libct_re, readdir(DIR) );
        closedir(DIR);
        if ( grep( /libsybct/, @files ) ) {
                $newlibnames = 1;

From https://www.google.com/accounts/o8/id?id=AItOawlVEP5IYeRHpH3ZT4ELVsJ3INWz0Lpegpo on 2014-01-24 22:07:25
:

Oops, a syntactic fix in the patch:

==== //depot/QA/Toolbox/main.br/CPAN/DBD-Sybase/1.15/src/Makefile.PL#7 - /ns/build/users/ferencis/0toolbox/main.br/CPAN/DBD-Sybase/1.15/src/Makefile.PL ====
--- /tmp/tmp.10252.20   2014-01-24 22:06:21.000000000 +0000
+++ /ns/build/users/ferencis/0toolbox/main.br/CPAN/DBD-Sybase/1.15/src/Makefile.PL      2014-01-24 22:04:07.000000000 +0000
@@ -19,6 +19,8 @@
 $LINKTYPE         = 'dynamic';
 $written_pwd_file = 'PWD';

+my $libct_re = qr/\blib(syb)?ct(64)?\./i;
+
 my $file;
 my $chained;
 my $threaded_libs;
@@ -342,7 +344,7 @@
        opendir( DIR, $lib );

        # reverse to pick up libsybct before libct...
-       my @files = reverse( grep( /lib(syb)?ct(64)?\./, readdir(DIR) ) );
+       my @files = reverse( grep( /$libct_re/, readdir(DIR) ) );
        closedir(DIR);
        my $file;
        foreach (@files) {
@@ -410,7 +412,7 @@
        my $dir = shift;

        opendir( DIR, $dir ) || die "Can't access $dir: $!";
-       my @files = grep( /libct|libsybct/i, readdir(DIR) );
+       my @files = grep( /$libct_re/, readdir(DIR) );
        closedir(DIR);
        if ( grep( /libsybct/, @files ) ) {
                $newlibnames = 1;