Skip to content

Commit

Permalink
dev-perl/DBI-Shell: Fix '.' in @inc w/ rbump bug #615592
Browse files Browse the repository at this point in the history
- EAPI6
- Fix (runtime) '.' in @inc issue
- fix no_chrdir issue with newer File::Find
- fix localisation of $^W ( started warning in 5.10 )
- silenct warning about excess sprintf

Bug: https://bugs.gentoo.org/615592
Package-Manager: Portage-2.3.8, Repoman-2.3.3
  • Loading branch information
kentfredric committed Oct 8, 2017
1 parent 3667059 commit e767897
Show file tree
Hide file tree
Showing 5 changed files with 143 additions and 0 deletions.
27 changes: 27 additions & 0 deletions dev-perl/DBI-Shell/DBI-Shell-11.950.0-r2.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=6

DIST_AUTHOR=TLOWERY
DIST_VERSION=11.95
inherit perl-module

DESCRIPTION="Interactive command shell for the DBI"

SLOT="0"
KEYWORDS="~amd64 ~ppc ~x86"
IUSE=""

RDEPEND="dev-perl/IO-Tee
dev-perl/Text-Reform
dev-perl/DBI
dev-perl/Text-CSV_XS"
DEPEND="${RDEPEND}"

PATCHES=(
"${FILESDIR}/${P}-perl526.patch"
"${FILESDIR}/${P}-local-scalar.patch"
"${FILESDIR}/${P}-nochrdir.patch"
"${FILESDIR}/${P}-sprintf-warn.patch"
)
26 changes: 26 additions & 0 deletions dev-perl/DBI-Shell/files/DBI-Shell-11.950.0-local-scalar.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
From ef8efc5b80c9395c01f23e5acd28bb3ee7810b54 Mon Sep 17 00:00:00 2001
From: Kent Fredric <[email protected]>
Date: Sun, 8 Oct 2017 13:08:20 +1300
Subject: Fix useless localization of scalar assignment

Bug: https://rt.cpan.org/Ticket/Display.html?id=73873
---
lib/DBI/Format.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/DBI/Format.pm b/lib/DBI/Format.pm
index 49cd7dd..bc985f9 100755
--- a/lib/DBI/Format.pm
+++ b/lib/DBI/Format.pm
@@ -374,7 +374,7 @@ sub header {

sub row {
my($self, $rowref) = @_;
- local( $^W = 0 );
+ local ($^W) = 0;
my @row = @$rowref;
my $fh = $self->{'fh'};
print $fh (join($self->{sep}, @row), "\n");
--
2.14.1

26 changes: 26 additions & 0 deletions dev-perl/DBI-Shell/files/DBI-Shell-11.950.0-nochrdir.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
From 9fb29d16514530245965b932040bb4fc37ffa9bf Mon Sep 17 00:00:00 2001
From: Kent Fredric <[email protected]>
Date: Sun, 8 Oct 2017 13:11:29 +1300
Subject: Fix no_chrdir warning

Bug: https://rt.cpan.org/Ticket/Display.html?id=123215
---
lib/DBI/Shell/FindSqlFile.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/DBI/Shell/FindSqlFile.pm b/lib/DBI/Shell/FindSqlFile.pm
index e604290..2b56ccc 100644
--- a/lib/DBI/Shell/FindSqlFile.pm
+++ b/lib/DBI/Shell/FindSqlFile.pm
@@ -62,7 +62,7 @@ sub look_for_file {
File::Find::find(
{
wanted => \&wanted
- , no_chrdir => 1
+ , no_chdir => 1
, bydepth => 0
},
@search_path);
--
2.14.1

39 changes: 39 additions & 0 deletions dev-perl/DBI-Shell/files/DBI-Shell-11.950.0-perl526.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
From 792cf15cb387e58cec1ef3c6d538689d02ab44c3 Mon Sep 17 00:00:00 2001
From: Kent Fredric <[email protected]>
Date: Sun, 8 Oct 2017 12:46:17 +1300
Subject: Fix '.' removal from @INC in Perl 5.26

Configuration files were always assumed to be explicit paths given
by outsiders, not random entries in @INC

Bug: https://bugs.gentoo.org/615592
Bug: https://rt.cpan.org/Ticket/Display.html?id=121136
---
lib/DBI/Shell.pm | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/DBI/Shell.pm b/lib/DBI/Shell.pm
index 03dd958..7869f0f 100755
--- a/lib/DBI/Shell.pm
+++ b/lib/DBI/Shell.pm
@@ -133,6 +133,7 @@ use Text::Abbrev ();
use Term::ReadLine;
use Getopt::Long 2.17; # upgrade from CPAN if needed: http://www.perl.com/CPAN
use IO::File;
+use File::Spec ();

use DBI 1.00 qw(:sql_types :utils);
use DBI::Format;
@@ -544,7 +545,8 @@ sub configuration {
$sh->{config_file} = $ENV{DBISH_CONFIG} || "$homedir/.dbish_config";
my $config;
if ($sh->{config_file} && -f $sh->{config_file}) {
- $config = require $sh->{config_file};
+ my $full = File::Spec->rel2abs( $sh->{config_file} );
+ $config = require $full;
# allow for custom configuration options.
if (exists $config->{'options'} ) {
$sh->install_options( $config->{'options'} );
--
2.14.1

25 changes: 25 additions & 0 deletions dev-perl/DBI-Shell/files/DBI-Shell-11.950.0-sprintf-warn.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From f44b8ba9d8cf954c76a967cbfb5d4182f109f8cf Mon Sep 17 00:00:00 2001
From: Kent Fredric <[email protected]>
Date: Sun, 8 Oct 2017 13:30:36 +1300
Subject: Silence warnings about reduntant sprintf args

Bug: https://rt.cpan.org/Ticket/Display.html?id=123216
---
lib/DBI/Format/SQLMinus.pm | 1 +
1 file changed, 1 insertion(+)

diff --git a/lib/DBI/Format/SQLMinus.pm b/lib/DBI/Format/SQLMinus.pm
index c3a9ba2..7b240c9 100755
--- a/lib/DBI/Format/SQLMinus.pm
+++ b/lib/DBI/Format/SQLMinus.pm
@@ -155,6 +155,7 @@ sub header {

if ( exists $cf->{format} and defined $cf->{format} ) {
$format_names = $cf->{format};
+ no warnings 'redundant';
$width = length sprintf( $format_names, " " );
}

--
2.14.1

0 comments on commit e767897

Please sign in to comment.