diff options
Diffstat (limited to 'config-db/OpenSLX')
-rw-r--r-- | config-db/OpenSLX/AttributeRoster.pm | 8 | ||||
-rw-r--r-- | config-db/OpenSLX/DBSchema.pm | 36 |
2 files changed, 39 insertions, 5 deletions
diff --git a/config-db/OpenSLX/AttributeRoster.pm b/config-db/OpenSLX/AttributeRoster.pm index 0308540e..e196b5d3 100644 --- a/config-db/OpenSLX/AttributeRoster.pm +++ b/config-db/OpenSLX/AttributeRoster.pm @@ -410,14 +410,14 @@ sub getAttrInfo } elsif (defined $params->{scope}) { my %MatchingAttributeInfo; - my $lcScope = lc($params->{scope}); + my $selectedScope = lc($params->{scope}); foreach my $attr (keys %AttributeInfo) { my $attrScope = ''; if ($attr =~ m{^(.+?)::}) { - $attrScope = $1; + $attrScope = lc($1); } - if ((!$attrScope && $lcScope eq 'core') - || lc($attrScope) eq $lcScope) { + if ((!$attrScope && $selectedScope eq 'core') + || $attrScope eq $selectedScope) { $MatchingAttributeInfo{$attr} = $AttributeInfo{$attr}; } } diff --git a/config-db/OpenSLX/DBSchema.pm b/config-db/OpenSLX/DBSchema.pm index aa6ef1c1..ede1b9a3 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.23; +my $VERSION = 0.24; my $DbSchema = { 'version' => $VERSION, @@ -624,6 +624,40 @@ sub _schemaUpgradeDBFrom 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()) { + my $attrs = $system->{attrs} || {}; + next if !exists $attrs->{'theme::name'}; + $attrs->{'theme::splash'} + = $attrs->{'theme::displaymanager'} + = $attrs->{'theme::desktop'} + = $attrs->{'theme::name'}; + delete $attrs->{'theme::name'}; + $metaDB->setSystemAttrs($system->{id}, $attrs); + } + + # force all theme names to lowercase + foreach my $vendorOS ($metaDB->fetchVendorOSByFilter()) { + my @installedPlugins + = $metaDB->fetchInstalledPlugins($vendorOS->{id}); + foreach my $plugin (@installedPlugins) { + my $pluginName = $plugin->{plugin_name}; +print "$vendorOS->{id} $pluginName\n"; + $metaDB->removeInstalledPlugin($vendorOS->{id}, $pluginName); + $metaDB->addInstalledPlugin($vendorOS->{id}, lc($pluginName)); + } + } + + $metaDB->schemaSetDBVersion(0.24); + + return 1; + }, ); 1; |