summaryrefslogtreecommitdiffstats
path: root/config-db/OpenSLX/MetaDB/CSV.pm
diff options
context:
space:
mode:
authorOliver Tappe2007-06-17 12:29:17 +0200
committerOliver Tappe2007-06-17 12:29:17 +0200
commit9ba85d5dc63dfd1e16b9ec85d532fe89ee58fd9b (patch)
tree176dc068777af9af1119c55648ec73e78517393e /config-db/OpenSLX/MetaDB/CSV.pm
parentEnabled busybox option to allow longer filenames in tar archives (see (diff)
downloadcore-9ba85d5dc63dfd1e16b9ec85d532fe89ee58fd9b.tar.gz
core-9ba85d5dc63dfd1e16b9ec85d532fe89ee58fd9b.tar.xz
core-9ba85d5dc63dfd1e16b9ec85d532fe89ee58fd9b.zip
largish change with respect to configurable paths:
* instead of supporting configurable paths at different hierarchy levels, there are now only five configurable folder: + base-path (/opt/openslx), fixed at installation time + config-path (/etc/opt/openslx), fixed at installation time + private-path (/var/opt/openslx), freely configurable by user + public-path (/srv/openslx), freely configurable by user + temp-path (/tmp), freely configurable by user this closes ticket#143 * several holes have been plugged concerning the creation of folders before they are accessed, closing ticket#142 * the functionality of generating config default folders has been moved from the Makefile into a new Perl-module (ConfigFolder.pm), in order to be available to the Perl-scripts, too * slxsettings has been changed to reflect the nature of base-path and config-path as fixed paths git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1172 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'config-db/OpenSLX/MetaDB/CSV.pm')
-rw-r--r--config-db/OpenSLX/MetaDB/CSV.pm15
1 files changed, 5 insertions, 10 deletions
diff --git a/config-db/OpenSLX/MetaDB/CSV.pm b/config-db/OpenSLX/MetaDB/CSV.pm
index 94335d25..cd2a7da4 100644
--- a/config-db/OpenSLX/MetaDB/CSV.pm
+++ b/config-db/OpenSLX/MetaDB/CSV.pm
@@ -48,22 +48,17 @@ sub connect
my $dbSpec = $openslxConfig{'db-spec'};
if (!defined $dbSpec) {
# build $dbSpec from individual parameters:
- my $dbBasepath = $openslxConfig{'db-basepath'};
- my $dbDatadir = $openslxConfig{'db-datadir'}
- || "$openslxConfig{'db-name'}-csv";
+ my $dbBasepath = "$openslxConfig{'private-path'}/db";
+ my $dbDatadir = "$openslxConfig{'db-name'}-csv";
my $dbPath = "$dbBasepath/$dbDatadir";
- if (!-e $dbPath) {
- mkdir $dbPath
- or die _tr("unable to create db-datadir %s! (%s)\n",
- $dbPath, $!);
- }
+ system("mkdir -p $dbPath") unless -e $dbPath;
$dbSpec = "f_dir=$dbPath;csv_eol=\n;";
}
vlog 1, "trying to connect to CSV-database <$dbSpec>";
$self->{'dbh'} = DBI->connect("dbi:CSV:$dbSpec", undef, undef,
{PrintError => 0})
- or confess _tr("Cannot connect to database '%s' (%s)",
- $dbSpec, $DBI::errstr);
+ or die _tr("Cannot connect to database '%s' (%s)",
+ $dbSpec, $DBI::errstr);
}
sub quote