diff options
author | Oliver Tappe | 2007-06-17 12:29:17 +0200 |
---|---|---|
committer | Oliver Tappe | 2007-06-17 12:29:17 +0200 |
commit | 9ba85d5dc63dfd1e16b9ec85d532fe89ee58fd9b (patch) | |
tree | 176dc068777af9af1119c55648ec73e78517393e /config-db/OpenSLX | |
parent | Enabled busybox option to allow longer filenames in tar archives (see (diff) | |
download | core-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')
-rw-r--r-- | config-db/OpenSLX/ConfigDB.pm | 4 | ||||
-rw-r--r-- | config-db/OpenSLX/MetaDB/Base.pm | 10 | ||||
-rw-r--r-- | config-db/OpenSLX/MetaDB/CSV.pm | 15 | ||||
-rw-r--r-- | config-db/OpenSLX/MetaDB/SQLite.pm | 10 | ||||
-rw-r--r-- | config-db/OpenSLX/MetaDB/mysql.pm | 4 |
5 files changed, 14 insertions, 29 deletions
diff --git a/config-db/OpenSLX/ConfigDB.pm b/config-db/OpenSLX/ConfigDB.pm index b6755155..3926fb9f 100644 --- a/config-db/OpenSLX/ConfigDB.pm +++ b/config-db/OpenSLX/ConfigDB.pm @@ -176,7 +176,7 @@ sub connect vlog 0, "\t$dbMod\n"; } } - die _tr('Please use slxsettings to switch to another db-type.'); + die _tr('Please use slxsettings if you want to switch to another db-type.'); } $self->{'db-type'} = $dbType; @@ -957,7 +957,7 @@ sub aggregatedSystemFileInfoFor $info->{'vendor-os'} = $vendorOS; my $kernelPath - = "$openslxConfig{'stage1-path'}/$vendorOS->{name}/boot"; + = "$openslxConfig{'private-path'}/stage1/$vendorOS->{name}/boot"; $info->{'kernel-file'} = "$kernelPath/$system->{kernel}"; my $exportURI = $export->{'uri'}; diff --git a/config-db/OpenSLX/MetaDB/Base.pm b/config-db/OpenSLX/MetaDB/Base.pm index db1f2e7e..74daf5f1 100644 --- a/config-db/OpenSLX/MetaDB/Base.pm +++ b/config-db/OpenSLX/MetaDB/Base.pm @@ -378,16 +378,6 @@ the following entries in order to find out which database to connect to: =over -=item C<$config{'db-basepath'}> - -Basic path to openslx database, defaults to path of running script - -=item C<$config{'db-datadir'}> - -Data folder created under db-basepath, default depends on db-type (many -DBMSs don't have such a folder, as they do not store the data in the -filesystem). - =item C<$config{'db-spec'}> Full specification of database, a special string defining the 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 diff --git a/config-db/OpenSLX/MetaDB/SQLite.pm b/config-db/OpenSLX/MetaDB/SQLite.pm index 147b2061..d2b91a03 100644 --- a/config-db/OpenSLX/MetaDB/SQLite.pm +++ b/config-db/OpenSLX/MetaDB/SQLite.pm @@ -45,10 +45,10 @@ 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'} || 'sqlite'; + my $dbBasepath = "$openslxConfig{'private-path'}/db"; + my $dbDatadir = 'sqlite'; my $dbPath = "$dbBasepath/$dbDatadir"; - mkdir $dbPath unless -e $dbPath; + system("mkdir -p $dbPath") unless -e $dbPath; $dbSpec = "dbname=$dbPath/$openslxConfig{'db-name'}"; } vlog 1, "trying to connect to SQLite-database <$dbSpec>"; @@ -57,8 +57,8 @@ sub connect so there is no support for %s available, sorry!\n%s], 'DBD::SQLite', 'SQLite', $@); $self->{'dbh'} = DBI->connect("dbi:SQLite:$dbSpec", undef, undef, {PrintError => 0, AutoCommit => 1}) - 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 schemaRenameTable diff --git a/config-db/OpenSLX/MetaDB/mysql.pm b/config-db/OpenSLX/MetaDB/mysql.pm index 231e1bda..25cc93a8 100644 --- a/config-db/OpenSLX/MetaDB/mysql.pm +++ b/config-db/OpenSLX/MetaDB/mysql.pm @@ -51,8 +51,8 @@ sub connect vlog 1, "trying to connect user <$user> to mysql-database <$dbSpec>"; $self->{'dbh'} = DBI->connect("dbi:mysql:$dbSpec", $user, '', {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 schemaConvertTypeDescrToNative |