Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 868706 Details for
Bug 914265
perl-DBD-AnyData: FTBFS in rawhide
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
I'm about to retire this package, but in case someone wants to take it up, this is the patch referenced in comment 5, minus the very large number of whitespace changes.
DBD-AnyData-0.110-use-DBD-File.patch (text/plain), 13.10 KB, created by
Tom "spot" Callaway
on 2014-02-27 19:52:11 UTC
(
hide
)
Description:
I'm about to retire this package, but in case someone wants to take it up, this is the patch referenced in comment 5, minus the very large number of whitespace changes.
Filename:
MIME Type:
Creator:
Tom "spot" Callaway
Created:
2014-02-27 19:52:11 UTC
Size:
13.10 KB
patch
obsolete
>diff -up DBD-AnyData-0.110/lib/DBD/AnyData.pm.old DBD-AnyData-0.110/lib/DBD/AnyData.pm >--- DBD-AnyData-0.110/lib/DBD/AnyData.pm.old 2010-07-17 02:33:53.000000000 -0400 >+++ DBD-AnyData-0.110/lib/DBD/AnyData.pm 2014-02-27 11:27:48.429612061 -0500 >@@ -1,7 +1,10 @@ > ######################################################################### > # DBD::AnyData - a DBI driver for files and data structures > # >-# This module is copyright (c), 2001 by Jeff Zucker >+# This module is copyright (c) >+# 2001 by Jeff Zucker >+# 2010 by Jens Rehsack >+# 2014 by Lucio Iacolettig > # All rights reserved. > # > # This is free software. You may distribute it under >@@ -21,48 +24,20 @@ use strict; > use warnings; > > use AnyData; >-require DBI::DBD::SqlEngine; >-use base qw(DBI::DBD::SqlEngine); >-require SQL::Statement; >-require SQL::Eval; >+require DBD::File; >+our @ISA = qw( DBD::File ); > >-use vars qw($VERSION $err $errstr $sqlstate $drh $methods_already_installed); >+use vars qw(@ISA $VERSION $ATTRIBUTION $drh $err $errstr $sqlstate); > >-$VERSION = '0.110'; >+$VERSION = '0.111'; >+$ATTRIBUTION = "DBD::AnyData $DBD::AnyData::VERSION by Jeff Zucker, Jens >+Rehsack, Lucio Iacolettig"; > > $err = 0; # holds error code for DBI::err > $errstr = ""; # holds error string for DBI::errstr > $sqlstate = ""; # holds SQL state for DBI::state > $drh = undef; # holds driver handle once initialized > >-sub driver >-{ >- my ( $class, $attr ) = @_; >- return $drh if $drh; # already created - return same one >- $drh = $class->SUPER::driver( >- { >- 'Name' => 'AnyData', >- 'Version' => $VERSION, >- 'Err' => \$DBD::AnyData::err, >- 'Errstr' => \$DBD::AnyData::errstr, >- 'State' => \$DBD::AnyData::sqlstate, >- 'Attribution' => 'DBD::AnyData by Jens Rehsack', >- } >- ); >- >- unless ( $methods_already_installed++ ) >- { >- DBD::AnyData::db->install_method('ad_import'); >- DBD::AnyData::db->install_method('ad_catalog'); >- DBD::AnyData::db->install_method('ad_convert'); >- DBD::AnyData::db->install_method('ad_export'); >- DBD::AnyData::db->install_method('ad_clear'); >- DBD::AnyData::db->install_method('ad_dump'); >- } >- >- return $drh; >-} >- > sub CLONE > { > undef $drh; >@@ -73,19 +48,17 @@ package DBD::AnyData::dr; # ====== DR > use strict; > use warnings; > >-use vars qw($imp_data_size); >- >-$DBD::AnyData::dr::imp_data_size = 0; >-@DBD::AnyData::dr::ISA = qw(DBI::DBD::SqlEngine::dr); >+use vars qw(@ISA); > >-sub disconnect_all >-{ >- shift->{ad_tables} = {}; >-} >- >-sub DESTROY >-{ >- shift->{ad_tables} = {}; >+our $imp_data_size = 0; >+our @ISA = qw(DBD::File::dr); >+our $data_sources_attr = undef; >+ >+sub connect { >+ my ($drh, $dbname, $user, $auth, $attr) = @_; >+ my $dbh = $drh->DBD::File::dr::connect ($dbname, $user, $auth, $attr); >+ $dbh->{Active} = 1; >+ $dbh; > } > > package DBD::AnyData::db; # ====== DATABASE ====== >@@ -93,13 +66,11 @@ package DBD::AnyData::db; # ====== DA > use strict; > use warnings; > >-use vars qw($imp_data_size); >- > require Cwd; > require File::Spec; > >-$DBD::AnyData::db::imp_data_size = 0; >-@DBD::AnyData::db::ISA = qw(DBI::DBD::SqlEngine::db); >+our $imp_data_size = 0; >+our @ISA = qw(DBD::File::db); > > sub init_default_attributes > { >@@ -115,9 +86,9 @@ sub init_default_attributes > > sub set_versions > { >- my $this = $_[0]; >- $this->{ad_version} = $DBD::AnyData::VERSION; >- return $this->SUPER::set_versions(); >+ my $self = shift; >+ $self->{ad_version} = $DBD::AnyData::VERSION; >+ return $self->SUPER::set_versions(); > } > > sub disconnect >@@ -210,33 +181,23 @@ sub ad_export > #use Data::Dumper; print Dumper $catalog; > if ( $catalog->{format} && 'XML HTMLtable' =~ /$catalog->{format}/ ) > { >- #use Data::Dumper; print "!",Dumper $catalog; exit; > my $sth = $dbh->prepare("SELECT 1 FROM $table_name") or die DBI->errstr; > $sth->execute; # or die DBI->errstr; >-###z return $catalog->{ad}->export($format,$file_name,$flags) if 'XML HTMLtable' =~ /$format/; > return $catalog->{ad}->export( $file_name, $flags ) if 'XML HTMLtable' =~ /$format/; > $data = $dbh->selectall_arrayref("SELECT * FROM $table_name"); >- #my $sth = $dbh->prepare("SELECT * FROM $table_name"); >- #$sth->execute; >- #unshift @$data, $sth->{NAME}; > } > else > { >- #z $data = $dbh->func($table_name,'ad_get_catalog')->{records}; > my $sth = $dbh->prepare("SELECT * FROM $table_name WHERE 1=0"); > $sth->execute; > $data = $catalog->{ad}->{storage}->{records}; > } > $data = $dbh->selectall_arrayref("SELECT * FROM $table_name") > if $format =~ /XML|HTMLtable/; >- #use Data::Dumper; >- #die Dumper $data; >- # print Dumper $dbh->func( $table_name,'ad_get_catalog'); > > my $newcols = $dbh->func( $table_name, 'ad_get_catalog' )->{ad}->{storage}->{col_names}; > unshift @$data, $newcols if $newcols; > return AnyData::adConvert( 'Base', $data, $format, $file_name, undef, $flags ); >- # return AnyData::adExport({},$format,$data,$file_name,undef,$flags); > } > > sub ad_convert >@@ -274,7 +235,6 @@ sub ad_import > $old_columns = $sth->{NAME}; > } > my $sql = $flags->{sql} || "SELECT * FROM $table_name"; >- # die $sql; > my @params = $flags->{params} || (); > if ( 'XML HTMLtable' =~ /$format/ ) > { >@@ -288,21 +248,17 @@ sub ad_import > { > $flags->{recs} = $file_name; > $flags->{storage} = 'RAM'; >- #$flags->{col_names} =$old_columns if $old_columns; > $dbh->func( $table_name, $format, '', $flags, 'ad_catalog' ); > } > else > { > $dbh->func( $table_name, $format, $file_name, $flags, 'ad_catalog' ); >- #$dbh->func(@_,'ad_catalog'); > } > my $dbh2 = $dbh; > $dbh2 = $file_name if $format eq 'DBI'; > my $sth = $dbh2->prepare($sql) or die DBI->errstr; >- # die "$sql"; > $sth->execute(@params) or die DBI->errstr; > my $cols = $sth->{NAME} or die DBI->errstr; >- # die @$cols; > my $records; > if ($old_records) > { >@@ -337,7 +293,6 @@ sub ad_import > } > if ($dup) > { >- #print "@tmp"; > $dbh->do("DELETE FROM temp__ WHERE $lookup = $val") > or die DBI->errstr; > } >@@ -366,7 +321,6 @@ sub ad_import > delete $flags->{recs}; > delete $flags->{storage}; > delete $flags->{format}; >- #$flags = {} if 'XML HTMLtable' =~ /$format/; > if ( 'XML HTMLtable' =~ /$format/ ) > { > delete $flags->{ad}; >@@ -452,7 +406,6 @@ sub ad_dump > } > > # END OF DRIVER PRIVATE METHODS >- > sub get_avail_tables > { > my $dbh = $_[0]; >@@ -483,26 +436,48 @@ package DBD::AnyData::st; # ====== ST > use strict; > use warnings; > >-use vars qw($imp_data_size); >- >-$DBD::AnyData::st::imp_data_size = 0; >-@DBD::AnyData::st::ISA = qw(DBI::DBD::SqlEngine::st); >- >-# sub DESTROY ($) { undef; } >- >-# sub finish ($) {} >+our $imp_data_size = 0; >+our @ISA = qw(DBD::File::st); > > package DBD::AnyData::Statement; >+use strict; >+use warnings; >+use Carp; >+ >+our @ISA = qw(DBD::File::Statement); > >+# Table Class >+package DBD::AnyData::Table; > use strict; > use warnings; >+use Carp; >+ >+our @ISA = qw(DBD::File::Table); >+ >+sub bootstrap_table_meta >+{ >+ my ( $self, $dbh, $meta, $table ) = @_; >+ >+ $meta->{ad_class} ||= $dbh->{ad_class} || 'AnyData'; >+ $meta->{ad_eol} ||= $dbh->{ad_eol} || "\n"; >+ $self->SUPER::bootstrap_table_meta ( $dbh, $meta, $table ); >+} > >-@DBD::AnyData::Statement::ISA = qw(DBI::DBD::SqlEngine::Statement); >+sub init_table_meta >+{ >+ my ( $self, $dbh, $meta, $table ) = @_; >+ $self->SUPER::init_table_meta ( $dbh, $table, $meta ); >+ $meta->{dbh} = $dbh; >+} > >-sub open_table ($$$$$) >+sub open_data > { >- my ( $self, $data, $tname, $createMode, $lockMode ) = @_; >- my $dbh = $data->{Database}; >+ my ( $self, $meta, $attrs, $flags ) = @_; >+ my $dbh = $meta->{dbh}; >+ my $tname = $meta->{table_name}; >+ my $createMode = $flags->{createMode}; >+ my $lockMode = $flags->{lockMode}; >+ > my $catalog = $dbh->func( $tname, 'ad_get_catalog' ); > if ( !$catalog ) > { >@@ -520,14 +495,10 @@ sub open_table ($$$$$) > # || AnyData::adTable( $format, $file, $createMode, $lockMode, > # $catalog ); > || AnyData::adTable( $format, $file, $createMode, $lockMode, $catalog, $tname ); >- #print join("\n", $format,@$file,$createMode), "\n"; >- #use Data::Dumper; print Dumper $catalog; >- ################################################################# > my $table = $ad->prep_dbd_table( $tname, $createMode ); > my $cols = $table->{col_names}; > if ( $cols and ref $cols ne 'ARRAY' ) > { >- #$dbh->DBI::set_err(99, "\n $cols\n "); > print "\n $cols\n "; > exit; > } >@@ -539,25 +510,8 @@ sub open_table ($$$$$) > $dbh->func( $tname, 'ad', $ad, 'ad_mod_catalog' ); > } > >- return DBD::AnyData::Table->new($table); >-} >- >-package DBD::AnyData::Table; >- >-use strict; >-use warnings; >- >-use Params::Util qw(_HASH0); >- >-@DBD::AnyData::Table::ISA = qw(DBI::DBD::SqlEngine::Table); >- >-sub new >-{ >- my ( $proto, $attr ) = @_; >- $attr->{col_names} = $attr->{ad}->{storage}->{col_names}; >- $attr->{col_nums} = $attr->{ad}->{storage}->{col_nums}; >- delete $attr->{col_nums} unless ( defined( $attr->{col_nums} ) and defined( _HASH0( $attr->{col_nums} ) ) ); >- return $proto->SUPER::new($attr); >+ $meta->{ad} = $ad; >+ $meta->{col_names} = $cols; > } > > sub trim >@@ -573,7 +527,7 @@ sub fetch_row ($$$) > my ( $self, $data, $row ) = @_; > my $requested_cols = $data->{sql_stmt}->{NAME}; > my $dbh = $data->{Database}; >- my $fields = $self->{ad}->fetch_row($requested_cols); >+ my $fields = $self->{meta}->{ad}->fetch_row($requested_cols); > if ( $dbh->{ChopBlanks} ) > { > @$fields = map( $_ = &trim($_), @$fields ); >@@ -585,8 +539,7 @@ sub fetch_row ($$$) > sub push_names ($$$) > { > my ( $self, $data, $names ) = @_; >- #print @$names; >- $self->{ad}->push_names($names); >+ $self->{meta}->{ad}->push_names($names); > } > > sub push_row ($$$) >@@ -594,38 +547,46 @@ sub push_row ($$$) > my ( $self, $data, $fields ) = @_; > my $requested_cols = []; > my @rc = $data->{sql_stmt}->columns(); >+ >+ # PATCH: If the value is undefined initialize to avoid field shift (LI 2013-01-13) >+ map { >+ unless(defined($_)) { >+ $_ = ''; >+ } >+ } @{$fields}; >+ > push @$requested_cols, $_->{column} for @rc; > unshift @$fields, $requested_cols; >- $self->{ad}->push_row(@$fields); >+ $self->{meta}->{ad}->push_row(@$fields); >+ > 1; > } > > sub seek ($$$$) > { > my ( $self, $data, $pos, $whence ) = @_; >- $self->{ad}->seek( $pos, $whence ); >+ $self->{meta}->{ad}->seek( $pos, $whence ); > } > > sub drop ($$) > { > my ( $self, $data ) = @_; >- return $self->{ad}->drop(); >+ return $self->{meta}->{ad}->drop(); > } > > sub truncate ($$) > { > my ( $self, $data ) = @_; >- $self->{ad}->truncate($data); >+ $self->{meta}->{ad}->truncate( $data ); > } > > sub DESTROY > { >- # wierd: this is needed to close file handle ??? >+ # weird: this is needed to close file handle ??? > my $self = shift; >- #print "CLOSING" if $self->{ad}->{storage}->{fh}; >- my $fh = $self->{ad}->{storage}->{fh} or return; >- $self->{ad}->DESTROY; >- undef $self->{ad}->{storage}->{fh}; >+ my $fh = $self->{meta}->{ad}->{storage}->{fh} or return; >+ $self->{meta}->{ad}->DESTROY; >+ undef $self->{meta}->{ad}->{storage}->{fh}; > } > > =head1 NAME >@@ -691,7 +652,7 @@ Here a just a few examples of the capabi > # SELECT DATA FROM A PASSWD FILE > # > $dbh->func( 'users', 'Passwd', '/etc/passwd', 'ad_catalog'); >- my $sth = $dbh->prepare("SELECT username,homedir,GID FROM users'); >+ my $sth = $dbh->prepare('SELECT username,homedir,GID FROM users'); > > # INSERT A NEW ROW INTO A CSV FILE > # >@@ -719,13 +680,13 @@ Here a just a few examples of the capabi > To use DBD::AnyData you will need to install these modules, > all available from CPAN and most available from activeState. > >- * DBI >- * DBI::DBD::SqlEngine >- * SQL::Statement >- * AnyData >- * DBD::AnyData >+ * DBI >= 1.623 >+ * DBD::File >+ * SQL::Statement >= 1.27 >+ * AnyData >= 0.10 >+ * DBD::AnyData >= 0.20 > >-Note: DBI::DBD::SqlEngine is part of the DBI distribution >+Note: DBD::File is part of the DBI distribution > > Some advanced features require additional modules: > >@@ -1776,6 +1737,8 @@ Copyright 2000, Jeff Zucker <jeff@vpserv > > Copyright 2010, Jens Rehsack <rehsack@cpan.org> > >+Copyright 2014, Lucio Iacolettig <liacolettig@over-log.it> >+ > This program is free software; you can redistribute it and/or modify it > under the terms of either: the GNU General Public License as published > by the Free Software Foundation; or the Artistic License.
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 914265
: 868706