diff options
author | Oliver Tappe | 2008-04-21 14:51:24 +0200 |
---|---|---|
committer | Oliver Tappe | 2008-04-21 14:51:24 +0200 |
commit | 4193b0262f4b26c97c8b41b0a375d786d1690995 (patch) | |
tree | 3c0e45a580bfc29163e5ceeb4ad21bf76c4d0de6 /os-plugins/plugins/desktop/OpenSLX/OSPlugin/desktop.pm | |
parent | Quickfix for failing stage3 start if desktop plugin was installed (diff) | |
download | core-4193b0262f4b26c97c8b41b0a375d786d1690995.tar.gz core-4193b0262f4b26c97c8b41b0a375d786d1690995.tar.xz core-4193b0262f4b26c97c8b41b0a375d786d1690995.zip |
* intermediate check-in of recent work at the desktop plugin - GDM handling
now seems to work with SUSE and Ubuntu, but proper integration will have
to wait until I have shaken off the flu
git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@1752 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'os-plugins/plugins/desktop/OpenSLX/OSPlugin/desktop.pm')
-rw-r--r-- | os-plugins/plugins/desktop/OpenSLX/OSPlugin/desktop.pm | 49 |
1 files changed, 43 insertions, 6 deletions
diff --git a/os-plugins/plugins/desktop/OpenSLX/OSPlugin/desktop.pm b/os-plugins/plugins/desktop/OpenSLX/OSPlugin/desktop.pm index 70f8d71c..a3ce54ee 100644 --- a/os-plugins/plugins/desktop/OpenSLX/OSPlugin/desktop.pm +++ b/os-plugins/plugins/desktop/OpenSLX/OSPlugin/desktop.pm @@ -230,6 +230,7 @@ sub installationPhase if ($self->{xdm}) { $self->_setupXDM(); } + $self->_setupSupportedThemes(); return; } @@ -379,7 +380,6 @@ sub _ensureSensibleStage3Attrs sub _setupGDM { my $self = shift; - my $attrs = shift; my $repoPath = $self->{pluginRepositoryPath}; mkpath([ @@ -418,10 +418,26 @@ sub _setupGDMScript my $script = unshiftHereDoc(<<" End-of-Here"); #!/bin/ash # written by OpenSLX-plugin 'desktop' + mkdir -p $paths 2>/dev/null - ln -sf $repoPath/gdm/\$desktop_mode/gdm.conf /mnt$configFile + + mkdir -p \$(dirname /mnt$configFile) 2>/dev/null + cp /mnt/$repoPath/gdm/\$desktop_mode/gdm.conf /mnt$configFile + + # activate theme only if the corresponding xml file is found + # (otherwise fall back to default theme of vendor-OS) + if [ -n "\$desktop_theme" ]; then + thdir=/opt/openslx/plugin-repo/desktop/themes + theme=\$desktop_theme + if [ -e /mnt\$thdir/\$desktop_theme/gdm/\${theme}.xml ]; then + sed -i "s,\\[greeter\\],[greeter]\\nGraphicalThemeDir=\$thdir," \\ + /mnt/$configFile + sed -i "s,\\[greeter\\],[greeter]\\nGraphicalTheme=\$theme," \\ + /mnt/$configFile + fi + fi End-of-Here - $script .= $self->{distro}->GDMRunlevelLinks(); + $script = $self->{distro}->patchGDMScript($script); spitFile("$repoPath/gdm/desktop.sh", $script); return; } @@ -429,14 +445,11 @@ sub _setupGDMScript sub _setupKDM { my $self = shift; - my $attrs = shift; - } sub _setupXDM { my $self = shift; - my $attrs = shift; } sub _writeConfigHash @@ -460,4 +473,28 @@ sub _writeConfigHash spitFile($file, $content); } +sub _setupSupportedThemes +{ + my $self = shift; + + my $supportedThemes = $self->{attrs}->{'desktop::supported_themes'} || ''; + my @supportedThemes = split m{\s*,\s*}, $supportedThemes; + return if !@supportedThemes; + + my $themeBaseDir = "$self->{openslxPath}/share/themes"; + THEME: + for my $theme (@supportedThemes) { + my $themeDir = "$themeBaseDir/$theme/displaymanager"; + if (!-e $themeDir) { + warn _tr('theme "%s" not found - skipped!', $theme); + next; + } + my $themeTargetPath = "$self->{pluginRepositoryPath}/themes/"; + mkpath($themeTargetPath); + vlog(1, "installing theme '$theme'..."); + slxsystem("cp -a $themeDir $themeTargetPath/$theme") == 0 + or die _tr('unable to copy theme %s (%s)', $theme, $!); + } +} + 1; |