diff options
author | Oliver Tappe | 2007-05-11 22:35:04 +0200 |
---|---|---|
committer | Oliver Tappe | 2007-05-11 22:35:04 +0200 |
commit | 6c9b8c2a7b04f3147a5013209893176fe423582f (patch) | |
tree | ee09cbd219d21fc12d6d5fc2f5caded6069dac4f /config-db | |
parent | * minor cleanup (diff) | |
download | core-6c9b8c2a7b04f3147a5013209893176fe423582f.tar.gz core-6c9b8c2a7b04f3147a5013209893176fe423582f.tar.xz core-6c9b8c2a7b04f3147a5013209893176fe423582f.zip |
* cleanup in DB-modules
* DBD::CSV is now required to be 0.22 or higher (to circumvent problems on SuSE-9.3)
git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1046 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'config-db')
-rw-r--r-- | config-db/OpenSLX/MetaDB/Base.pm | 2 | ||||
-rw-r--r-- | config-db/OpenSLX/MetaDB/CSV.pm | 11 | ||||
-rw-r--r-- | config-db/OpenSLX/MetaDB/DBI.pm | 7 | ||||
-rw-r--r-- | config-db/OpenSLX/MetaDB/SQLite.pm | 8 | ||||
-rw-r--r-- | config-db/OpenSLX/MetaDB/mysql.pm | 11 |
5 files changed, 16 insertions, 23 deletions
diff --git a/config-db/OpenSLX/MetaDB/Base.pm b/config-db/OpenSLX/MetaDB/Base.pm index db1f2e7e..ac15ac52 100644 --- a/config-db/OpenSLX/MetaDB/Base.pm +++ b/config-db/OpenSLX/MetaDB/Base.pm @@ -16,7 +16,7 @@ package OpenSLX::MetaDB::Base; use strict; use vars qw($VERSION); -$VERSION = 1.01; # API-version . implementation-version +$VERSION = 1; # API-version use Carp; diff --git a/config-db/OpenSLX/MetaDB/CSV.pm b/config-db/OpenSLX/MetaDB/CSV.pm index 5101f939..9d1418f4 100644 --- a/config-db/OpenSLX/MetaDB/CSV.pm +++ b/config-db/OpenSLX/MetaDB/CSV.pm @@ -13,9 +13,9 @@ # ----------------------------------------------------------------------------- package OpenSLX::MetaDB::CSV; -use vars qw(@ISA $VERSION); -@ISA = ('OpenSLX::MetaDB::DBI'); -$VERSION = 1.01; # API-version . implementation-version +use vars qw($VERSION); +$VERSION = 1; # API-version +use base qw(OpenSLX::MetaDB::DBI); ################################################################################ ### This class provides a MetaDB backend for CSV files (CSV = comma separated @@ -26,8 +26,8 @@ $VERSION = 1.01; # API-version . implementation-version use strict; use Carp; use Fcntl qw(:DEFAULT :flock); +use DBD::CSV 0.22; use OpenSLX::Basics; -use OpenSLX::MetaDB::DBI $VERSION; my $superVersion = $OpenSLX::MetaDB::DBI::VERSION; if ($superVersion < $VERSION) { @@ -63,9 +63,6 @@ sub connect $dbSpec = "f_dir=$dbPath;csv_eol=\n;"; } vlog 1, "trying to connect to CSV-database <$dbSpec>"; - eval ('require DBD::CSV; 1;') - or die _tr(qq[%s doesn't seem to be installed, -so there is no support for %s available, sorry!\n%s], 'DBD::CSV', 'CSV', $@); $self->{'dbh'} = DBI->connect("dbi:CSV:$dbSpec", undef, undef, {PrintError => 0}) or confess _tr("Cannot connect to database '%s' (%s)", diff --git a/config-db/OpenSLX/MetaDB/DBI.pm b/config-db/OpenSLX/MetaDB/DBI.pm index b7025e65..31f70350 100644 --- a/config-db/OpenSLX/MetaDB/DBI.pm +++ b/config-db/OpenSLX/MetaDB/DBI.pm @@ -14,14 +14,13 @@ package OpenSLX::MetaDB::DBI; use strict; -use vars qw(@ISA $VERSION); -@ISA = ('OpenSLX::MetaDB::Base'); -$VERSION = 1.01; # API-version . implementation-version +use vars qw($VERSION); +$VERSION = 1; # API-version +use base qw(OpenSLX::MetaDB::Base); use Carp; use DBI; use OpenSLX::Basics; -use OpenSLX::MetaDB::Base; my $superVersion = $OpenSLX::MetaDB::Base::VERSION; if ($superVersion < $VERSION) { diff --git a/config-db/OpenSLX/MetaDB/SQLite.pm b/config-db/OpenSLX/MetaDB/SQLite.pm index 4b574639..673ae1c0 100644 --- a/config-db/OpenSLX/MetaDB/SQLite.pm +++ b/config-db/OpenSLX/MetaDB/SQLite.pm @@ -13,9 +13,9 @@ # ----------------------------------------------------------------------------- package OpenSLX::MetaDB::SQLite; -use vars qw(@ISA $VERSION); -@ISA = ('OpenSLX::MetaDB::DBI'); -$VERSION = 1.01; # API-version . implementation-version +use vars qw($VERSION); +$VERSION = 1; # API-version +use base qw(OpenSLX::MetaDB::DBI); ################################################################################ ### This class provides a MetaDB backend for SQLite databases. @@ -23,8 +23,8 @@ $VERSION = 1.01; # API-version . implementation-version ################################################################################ use strict; use Carp; +use DBD::SQLite; use OpenSLX::Basics; -use OpenSLX::MetaDB::DBI $VERSION; my $superVersion = $OpenSLX::MetaDB::DBI::VERSION; if ($superVersion < $VERSION) { diff --git a/config-db/OpenSLX/MetaDB/mysql.pm b/config-db/OpenSLX/MetaDB/mysql.pm index 4e580af0..2d0c15d9 100644 --- a/config-db/OpenSLX/MetaDB/mysql.pm +++ b/config-db/OpenSLX/MetaDB/mysql.pm @@ -13,9 +13,9 @@ # ----------------------------------------------------------------------------- package OpenSLX::MetaDB::mysql; -use vars qw(@ISA $VERSION); -@ISA = ('OpenSLX::MetaDB::DBI'); -$VERSION = 1.01; # API-version . implementation-version +use vars qw($VERSION); +$VERSION = 1; # API-version +use base qw(OpenSLX::MetaDB::DBI); ################################################################################ ### This class provides a MetaDB backend for mysql databases. @@ -23,8 +23,8 @@ $VERSION = 1.01; # API-version . implementation-version ################################################################################ use strict; use Carp; +use DBD::mysql; use OpenSLX::Basics; -use OpenSLX::MetaDB::DBI $VERSION; my $superVersion = $OpenSLX::MetaDB::DBI::VERSION; if ($superVersion < $VERSION) { @@ -53,9 +53,6 @@ sub connect } my $user = (getpwuid($>))[0]; vlog 1, "trying to connect user <$user> to mysql-database <$dbSpec>"; - eval ('require DBD::mysql; 1;') - or die _tr(qq[%s doesn't seem to be installed, -so there is no support for %s available, sorry!\n%s], 'DBD::mysql', 'mysql', $@); $self->{'dbh'} = DBI->connect("dbi:mysql:$dbSpec", $user, '', {PrintError => 0}) or confess _tr("Cannot connect to database <%s> (%s)", |