diff options
| author | Oliver Tappe | 2008-02-09 21:17:10 +0100 |
|---|---|---|
| committer | Oliver Tappe | 2008-02-09 21:17:10 +0100 |
| commit | 55eba91c566d566b07fccb782ca35e0a829619d5 (patch) | |
| tree | 04e04c2a7bfbc644ea597415438e8899de18cafa /config-db/OpenSLX | |
| parent | * cmdline options are now collected in a hash instead of individual variables, (diff) | |
| download | core-55eba91c566d566b07fccb782ca35e0a829619d5.tar.gz core-55eba91c566d566b07fccb782ca35e0a829619d5.tar.xz core-55eba91c566d566b07fccb782ca35e0a829619d5.zip | |
* dropped attribute ramfs_screen as it is no longer needed (splashy does
not need to be given the screen-size) - updating schema version to 0.25
* little code simplification in DBSchema.pm
* removed ramfs_screen from all tests
* added method removeAttributeByName() to MetaDB in order to be able to
remove attributes from the DB in a simple manner
git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1528 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'config-db/OpenSLX')
| -rw-r--r-- | config-db/OpenSLX/AttributeRoster.pm | 10 | ||||
| -rw-r--r-- | config-db/OpenSLX/DBSchema.pm | 36 | ||||
| -rw-r--r-- | config-db/OpenSLX/MetaDB/DBI.pm | 10 |
3 files changed, 24 insertions, 32 deletions
diff --git a/config-db/OpenSLX/AttributeRoster.pm b/config-db/OpenSLX/AttributeRoster.pm index e196b5d3..b3366c01 100644 --- a/config-db/OpenSLX/AttributeRoster.pm +++ b/config-db/OpenSLX/AttributeRoster.pm @@ -166,16 +166,6 @@ sub _init content_descr => undef, default => 'forcedeth e1000 e100 tg3 via-rhine r8169 pcnet32', }, - 'ramfs_screen' => { - applies_to_systems => 1, - applies_to_clients => 0, - description => unshiftHereDoc(<<' End-of-Here'), - resolution of splash screen to use in stage3 - End-of-Here - content_regex => undef, - content_descr => undef, - default => '', - }, 'sane_scanner' => { applies_to_systems => 1, applies_to_clients => 1, diff --git a/config-db/OpenSLX/DBSchema.pm b/config-db/OpenSLX/DBSchema.pm index 3a0193dd..26d85465 100644 --- a/config-db/OpenSLX/DBSchema.pm +++ b/config-db/OpenSLX/DBSchema.pm @@ -35,7 +35,7 @@ use OpenSLX::Basics; ### fk => foreign key (integer) ################################################################################ -my $VERSION = 0.24; +my $VERSION = 0.25; my $DbSchema = { 'version' => $VERSION, @@ -341,9 +341,13 @@ sub _schemaUpgradeDBFrom my $metaDB = shift; my $currVersion = shift; - foreach my $version (sort { $a cmp $b } keys %DbSchemaHistory) { + foreach my $version (sort { $a <=> $b } keys %DbSchemaHistory) { next if $currVersion >= $version; - $DbSchemaHistory{$version}->($metaDB); + + vlog(0, "upgrading schema version to $version"); + if ($DbSchemaHistory{$version}->($metaDB)) { + $metaDB->schemaSetDBVersion($version); + } } return 1; @@ -353,8 +357,6 @@ sub _schemaUpgradeDBFrom 0.2 => sub { my $metaDB = shift; - vlog(0, "upgrading schema version to 0.2"); - # move attributes into separate tables ... # # ... system attributes ... @@ -560,15 +562,11 @@ sub _schemaUpgradeDBFrom ] ); - $metaDB->schemaSetDBVersion(0.2); - return 1; }, 0.21 => sub { my $metaDB = shift; - vlog(0, "upgrading schema version to 0.21"); - # add new table installed_plugins $metaDB->schemaAddTable( 'installed_plugin', @@ -579,27 +577,19 @@ sub _schemaUpgradeDBFrom ] ); - $metaDB->schemaSetDBVersion(0.21); - return 1; }, 0.22 => sub { my $metaDB = shift; - vlog(0, "upgrading schema version to 0.22"); - # dummy schema change, just to trigger the attribute synchronization # into the default system - $metaDB->schemaSetDBVersion(0.22); - return 1; }, 0.23 => sub { my $metaDB = shift; - vlog(0, "upgrading schema version to 0.23"); - # add new column system.descripion $metaDB->schemaAddColumns( 'system', @@ -620,15 +610,11 @@ sub _schemaUpgradeDBFrom ] ); - $metaDB->schemaSetDBVersion(0.23); - return 1; }, 0.24 => sub { my $metaDB = shift; - vlog(0, "upgrading schema version to 0.24"); - # split theme::name into theme::splash, theme::displaymanager and # theme::desktop foreach my $system ($metaDB->fetchSystemByFilter()) { @@ -653,7 +639,13 @@ sub _schemaUpgradeDBFrom } } - $metaDB->schemaSetDBVersion(0.24); + return 1; + }, + 0.25 => sub { + my $metaDB = shift; + + # drop attribute ramfs_screen + $metaDB->removeAttributeByName('ramfs_screen'); return 1; }, diff --git a/config-db/OpenSLX/MetaDB/DBI.pm b/config-db/OpenSLX/MetaDB/DBI.pm index 2d6b5a55..70bc504f 100644 --- a/config-db/OpenSLX/MetaDB/DBI.pm +++ b/config-db/OpenSLX/MetaDB/DBI.pm @@ -878,6 +878,16 @@ sub addClient return @clientIDs; } +sub removeAttributeByName +{ + my $self = shift; + my $attrName = shift; + + return $self->_doDelete('system_attr', [ $attrName ], 'name') + && $self->_doDelete('client_attr', [ $attrName ], 'name') + && $self->_doDelete('group_attr', [ $attrName ], 'name'); +} + sub removeClient { my $self = shift; |
