Skip to content

Commit

Permalink
dev-perl/DBD-mysql: Fix tests for '.' in @inc re bug #613608
Browse files Browse the repository at this point in the history
Apply modified patche(s) from upstream to fix dependency on '.'
in @inc during tests.

Bug: https://bugs.gentoo.org/613608
Package-Manager: Portage-2.3.6, Repoman-2.3.2
  • Loading branch information
kentfredric committed Jun 10, 2017
1 parent 3361bc4 commit 1bc4c8b
Show file tree
Hide file tree
Showing 4 changed files with 283 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dev-perl/DBD-mysql/DBD-mysql-4.41.0.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ DEPEND="${RDEPEND}
virtual/perl-Time-HiRes
)
"

PATCHES=( "${FILESDIR}/${DIST_VERSION}-no-dot-inc.patch" )
src_configure() {
if use test; then
myconf="${myconf} --testdb=test \
Expand Down
2 changes: 1 addition & 1 deletion dev-perl/DBD-mysql/DBD-mysql-4.42.0.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ DEPEND="${RDEPEND}
virtual/perl-Time-HiRes
)
"

PATCHES=( "${FILESDIR}/${DIST_VERSION}-no-dot-inc.patch" )
src_configure() {
if use test; then
myconf="${myconf} --testdb=test \
Expand Down
103 changes: 103 additions & 0 deletions dev-perl/DBD-mysql/files/4.041-no-dot-inc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
From 497224cad8b6469913c61ee856228bc1d0280980 Mon Sep 17 00:00:00 2001
From: Pali <[email protected]>
Date: Mon, 17 Apr 2017 21:38:58 +0200
Subject: [PATCH] Fix tests on Perl On 5.25.10 or greater with
-Ddefault_inc_excludes_dot

Some tests do not include dot in %INC and fails with error:
Can't locate t/lib.pl in @INC

Fixes: https://rt.cpan.org/Public/Bug/Display.html?id=120709
---
t/40server_prepare_crash.t | 3 ++-
t/rt25389-bin-case.t | 3 ++-
t/rt50304-column_info_parentheses.t | 3 ++-
t/rt61849-bind-param-buffer-overflow.t | 3 ++-
t/rt75353-innodb-lock-timeout.t | 3 ++-
t/rt83494-quotes-comments.t | 3 ++-
11 files changed, 22 insertions(+), 11 deletions(-)

diff --git a/t/40server_prepare_crash.t b/t/40server_prepare_crash.t
index e3777b9..d04eb9c 100644
--- a/t/40server_prepare_crash.t
+++ b/t/40server_prepare_crash.t
@@ -5,7 +5,8 @@ use Test::More;
use DBI;

use vars qw($test_dsn $test_user $test_password);
-require "t/lib.pl";
+use lib 't', '.';
+require "lib.pl";

my $dbh = DbiTestConnect($test_dsn, $test_user, $test_password, { PrintError => 1, RaiseError => 1, AutoCommit => 0, mysql_server_prepare => 1, mysql_server_prepare_disable_fallback => 1 });
plan skip_all => "You must have MySQL version 4.1.3 and greater for this test to run" if $dbh->{mysql_clientversion} < 40103 or $dbh->{mysql_serverversion} < 40103;
diff --git a/t/rt25389-bin-case.t b/t/rt25389-bin-case.t
index cbda8b7..3aee41b 100644
--- a/t/rt25389-bin-case.t
+++ b/t/rt25389-bin-case.t
@@ -4,7 +4,8 @@ use warnings;
use DBI;

use vars qw($test_dsn $test_user $test_password);
-require "t/lib.pl";
+use lib 't', '.';
+require "lib.pl";

use Test::More;

diff --git a/t/rt50304-column_info_parentheses.t b/t/rt50304-column_info_parentheses.t
index 76f9eff..6c3aac5 100644
--- a/t/rt50304-column_info_parentheses.t
+++ b/t/rt50304-column_info_parentheses.t
@@ -4,7 +4,8 @@ use warnings;
use DBI;

use vars qw($test_dsn $test_user $test_password $state);
-require "t/lib.pl";
+use lib 't', '.';
+require "lib.pl";

use Test::More;

diff --git a/t/rt61849-bind-param-buffer-overflow.t b/t/rt61849-bind-param-buffer-overflow.t
index 82baf2f..a3c75de 100644
--- a/t/rt61849-bind-param-buffer-overflow.t
+++ b/t/rt61849-bind-param-buffer-overflow.t
@@ -5,7 +5,8 @@ use Test::More;
use DBI;

use vars qw($test_dsn $test_user $test_password);
-require "t/lib.pl";
+use lib 't', '.';
+require "lib.pl";

my $INSECURE_VALUE_FROM_USER = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";

diff --git a/t/rt75353-innodb-lock-timeout.t b/t/rt75353-innodb-lock-timeout.t
index a1f437d..95694db 100644
--- a/t/rt75353-innodb-lock-timeout.t
+++ b/t/rt75353-innodb-lock-timeout.t
@@ -5,7 +5,8 @@ use Test::More;
use DBI;

use vars qw($test_dsn $test_user $test_password);
-require "t/lib.pl";
+use lib 't', '.';
+require "lib.pl";

my $dbh1 = DbiTestConnect($test_dsn, $test_user, $test_password, { RaiseError => 1, AutoCommit => 0 });

diff --git a/t/rt83494-quotes-comments.t b/t/rt83494-quotes-comments.t
index c48b0b9..83919f2 100644
--- a/t/rt83494-quotes-comments.t
+++ b/t/rt83494-quotes-comments.t
@@ -9,7 +9,8 @@ use DBI;
use Test::More;

use vars qw($test_dsn $test_user $test_password $state);
-require "t/lib.pl";
+use lib 't', '.';
+require "lib.pl";

my $dbh = DbiTestConnect($test_dsn, $test_user, $test_password,
{ RaiseError => 1, PrintError => 0, AutoCommit => 0 });
178 changes: 178 additions & 0 deletions dev-perl/DBD-mysql/files/4.042-no-dot-inc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
From 497224cad8b6469913c61ee856228bc1d0280980 Mon Sep 17 00:00:00 2001
From: Pali <[email protected]>
Date: Mon, 17 Apr 2017 21:38:58 +0200
Subject: [PATCH] Fix tests on Perl On 5.25.10 or greater with
-Ddefault_inc_excludes_dot

Some tests do not include dot in %INC and fails with error:
Can't locate t/lib.pl in @INC

Fixes: https://rt.cpan.org/Public/Bug/Display.html?id=120709
---
t/40server_prepare_crash.t | 3 ++-
t/55utf8_jp.t | 3 ++-
t/cve-2017-3302.t | 3 ++-
t/magic.t | 3 ++-
t/rt110983-valid-mysqlfd.t | 3 ++-
t/rt118977-zerofill.t | 3 ++-
t/rt25389-bin-case.t | 3 ++-
t/rt50304-column_info_parentheses.t | 3 ++-
t/rt61849-bind-param-buffer-overflow.t | 3 ++-
t/rt75353-innodb-lock-timeout.t | 3 ++-
t/rt83494-quotes-comments.t | 3 ++-
11 files changed, 22 insertions(+), 11 deletions(-)

diff --git a/t/40server_prepare_crash.t b/t/40server_prepare_crash.t
index e3777b9..d04eb9c 100644
--- a/t/40server_prepare_crash.t
+++ b/t/40server_prepare_crash.t
@@ -5,7 +5,8 @@ use Test::More;
use DBI;

use vars qw($test_dsn $test_user $test_password);
-require "t/lib.pl";
+use lib 't', '.';
+require "lib.pl";

my $dbh = DbiTestConnect($test_dsn, $test_user, $test_password, { PrintError => 1, RaiseError => 1, AutoCommit => 0, mysql_server_prepare => 1, mysql_server_prepare_disable_fallback => 1 });
plan skip_all => "You must have MySQL version 4.1.3 and greater for this test to run" if $dbh->{mysql_clientversion} < 40103 or $dbh->{mysql_serverversion} < 40103;
diff --git a/t/55utf8_jp.t b/t/55utf8_jp.t
index 638d494..88874c3 100644
--- a/t/55utf8_jp.t
+++ b/t/55utf8_jp.t
@@ -6,7 +6,8 @@ use DBI;
use Encode;

use vars qw($test_dsn $test_user $test_password);
-require "t/lib.pl";
+use lib 't', '.';
+require "lib.pl";

my $dbh = DbiTestConnect($test_dsn, $test_user, $test_password, { mysql_enable_utf8 => 1, PrintError => 1, RaiseError => 1 });

diff --git a/t/cve-2017-3302.t b/t/cve-2017-3302.t
index b2de927..fbca0e3 100644
--- a/t/cve-2017-3302.t
+++ b/t/cve-2017-3302.t
@@ -6,7 +6,8 @@ if ($ENV{SKIP_CRASH_TESTING}) {
no warnings 'once';
use DBI;
use vars qw($test_dsn $test_user $test_password $test_db);
-require "t/lib.pl";
+use lib 't', '.';
+require "lib.pl";
eval {
$dbh = DBI->connect($test_dsn, $test_user, $test_password, {RaiseError => 1, mysql_server_prepare => 1});
} or do {
diff --git a/t/magic.t b/t/magic.t
index 2720655..a7978a4 100644
--- a/t/magic.t
+++ b/t/magic.t
@@ -5,7 +5,8 @@ use Test::More;
use DBI;

use vars qw($test_dsn $test_user $test_password);
-require "t/lib.pl";
+use lib 't', '.';
+require "lib.pl";

my $tb = Test::More->builder;
binmode $tb->failure_output, ":utf8";
diff --git a/t/rt110983-valid-mysqlfd.t b/t/rt110983-valid-mysqlfd.t
index ad59762..12dace7 100644
--- a/t/rt110983-valid-mysqlfd.t
+++ b/t/rt110983-valid-mysqlfd.t
@@ -5,7 +5,8 @@ use Test::More;
use DBI;

use vars qw($test_dsn $test_user $test_password);
-require "t/lib.pl";
+use lib 't', '.';
+require "lib.pl";

my $dbh = DbiTestConnect($test_dsn, $test_user, $test_password, { RaiseError => 1, AutoCommit => 0 });

diff --git a/t/rt118977-zerofill.t b/t/rt118977-zerofill.t
index 1992c4c..328766b 100644
--- a/t/rt118977-zerofill.t
+++ b/t/rt118977-zerofill.t
@@ -5,7 +5,8 @@ use Test::More;
use DBI;

use vars qw($test_dsn $test_user $test_password);
-require "t/lib.pl";
+use lib 't', '.';
+require "lib.pl";

my $dbh = DbiTestConnect($test_dsn, $test_user, $test_password, { PrintError => 1, RaiseError => 1 });

diff --git a/t/rt25389-bin-case.t b/t/rt25389-bin-case.t
index cbda8b7..3aee41b 100644
--- a/t/rt25389-bin-case.t
+++ b/t/rt25389-bin-case.t
@@ -4,7 +4,8 @@ use warnings;
use DBI;

use vars qw($test_dsn $test_user $test_password);
-require "t/lib.pl";
+use lib 't', '.';
+require "lib.pl";

use Test::More;

diff --git a/t/rt50304-column_info_parentheses.t b/t/rt50304-column_info_parentheses.t
index 76f9eff..6c3aac5 100644
--- a/t/rt50304-column_info_parentheses.t
+++ b/t/rt50304-column_info_parentheses.t
@@ -4,7 +4,8 @@ use warnings;
use DBI;

use vars qw($test_dsn $test_user $test_password $state);
-require "t/lib.pl";
+use lib 't', '.';
+require "lib.pl";

use Test::More;

diff --git a/t/rt61849-bind-param-buffer-overflow.t b/t/rt61849-bind-param-buffer-overflow.t
index 82baf2f..a3c75de 100644
--- a/t/rt61849-bind-param-buffer-overflow.t
+++ b/t/rt61849-bind-param-buffer-overflow.t
@@ -5,7 +5,8 @@ use Test::More;
use DBI;

use vars qw($test_dsn $test_user $test_password);
-require "t/lib.pl";
+use lib 't', '.';
+require "lib.pl";

my $INSECURE_VALUE_FROM_USER = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";

diff --git a/t/rt75353-innodb-lock-timeout.t b/t/rt75353-innodb-lock-timeout.t
index a1f437d..95694db 100644
--- a/t/rt75353-innodb-lock-timeout.t
+++ b/t/rt75353-innodb-lock-timeout.t
@@ -5,7 +5,8 @@ use Test::More;
use DBI;

use vars qw($test_dsn $test_user $test_password);
-require "t/lib.pl";
+use lib 't', '.';
+require "lib.pl";

my $dbh1 = DbiTestConnect($test_dsn, $test_user, $test_password, { RaiseError => 1, AutoCommit => 0 });

diff --git a/t/rt83494-quotes-comments.t b/t/rt83494-quotes-comments.t
index c48b0b9..83919f2 100644
--- a/t/rt83494-quotes-comments.t
+++ b/t/rt83494-quotes-comments.t
@@ -9,7 +9,8 @@ use DBI;
use Test::More;

use vars qw($test_dsn $test_user $test_password $state);
-require "t/lib.pl";
+use lib 't', '.';
+require "lib.pl";

my $dbh = DbiTestConnect($test_dsn, $test_user, $test_password,
{ RaiseError => 1, PrintError => 0, AutoCommit => 0 });

0 comments on commit 1bc4c8b

Please sign in to comment.