From 2b82ec612a736bff7e0588846da09facd9bda1c8 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 19 Jan 2011 14:33:40 +0100 Subject: [PATCH] Initialisierung von %ENV von lx-erp.conf nach lx_office.conf verschoben --- SL/Dispatcher.pm | 22 ++++++++++++++++++++++ config/lx-erp.conf | 9 --------- config/lx-erp.conf.default | 9 --------- config/lx_office.conf.default | 9 ++++++++- 4 files changed, 30 insertions(+), 19 deletions(-) diff --git a/SL/Dispatcher.pm b/SL/Dispatcher.pm index 57e2b545b..d7e645dcd 100644 --- a/SL/Dispatcher.pm +++ b/SL/Dispatcher.pm @@ -77,6 +77,7 @@ sub pre_startup_setup { read_config 'config/lx_office.conf' => %::lx_office_conf; _decode_recursively(\%::lx_office_conf); + _init_environment(); eval { package main; @@ -334,6 +335,27 @@ sub _decode_recursively { } } +sub _init_environment { + my %key_map = ( lib => { name => 'PERL5LIB', append_path => 1 }, + path => { name => 'PATH', append_path => 1 }, + ); + my $cfg = $::lx_office_conf{environment} || {}; + + while (my ($key, $value) = each %{ $cfg }) { + next unless $value; + + my $info = $key_map{$key} || {}; + $key = $info->{name} || $key; + + if ($info->{append_path}) { + $value = ':' . $value unless $value =~ m/^:/ || !$ENV{$key}; + $value = $ENV{$key} . $value; + } + + $ENV{$key} = $value; + } +} + package main; use strict; diff --git a/config/lx-erp.conf b/config/lx-erp.conf index f28d8e3e6..16ad49287 100644 --- a/config/lx-erp.conf +++ b/config/lx-erp.conf @@ -23,12 +23,6 @@ $language = "de"; # if you have latex installed set to 1 $latex_templates = 1; -# if the server can't find gzip, latex, dvips or pdflatex, add the path -$ENV{PATH} .= ":/usr/local/bin"; - -# on mac os X using Fink's Perl libs, add the path -$ENV{PERL5LIB} .= ":/sw/lib/perl5"; - # Aktivierung der verschiedenen Spezialmodule $webdav = 0; $lizenzen = 1; @@ -63,9 +57,6 @@ $openofficeorg_daemon = 1; $openofficeorg_daemon_port = 2002; # Pfad zum "X virtual frame buffer", unter dem OpenOffice gestartet wird. -# Zusaetzlich muessen die Programme "xauth" und "mcookie" gefunden werden -# koennen, was eine Aenderung an PATH bedeuten kann. -$ENV{"PATH"} = $ENV{"PATH"} . ":/usr/X11R6/bin:/usr/X11/bin"; $xvfb_bin = "/usr/bin/Xvfb"; # Das charset, in dem die Daten in der Datenbank abgelegt sind. diff --git a/config/lx-erp.conf.default b/config/lx-erp.conf.default index f28d8e3e6..16ad49287 100644 --- a/config/lx-erp.conf.default +++ b/config/lx-erp.conf.default @@ -23,12 +23,6 @@ $language = "de"; # if you have latex installed set to 1 $latex_templates = 1; -# if the server can't find gzip, latex, dvips or pdflatex, add the path -$ENV{PATH} .= ":/usr/local/bin"; - -# on mac os X using Fink's Perl libs, add the path -$ENV{PERL5LIB} .= ":/sw/lib/perl5"; - # Aktivierung der verschiedenen Spezialmodule $webdav = 0; $lizenzen = 1; @@ -63,9 +57,6 @@ $openofficeorg_daemon = 1; $openofficeorg_daemon_port = 2002; # Pfad zum "X virtual frame buffer", unter dem OpenOffice gestartet wird. -# Zusaetzlich muessen die Programme "xauth" und "mcookie" gefunden werden -# koennen, was eine Aenderung an PATH bedeuten kann. -$ENV{"PATH"} = $ENV{"PATH"} . ":/usr/X11R6/bin:/usr/X11/bin"; $xvfb_bin = "/usr/bin/Xvfb"; # Das charset, in dem die Daten in der Datenbank abgelegt sind. diff --git a/config/lx_office.conf.default b/config/lx_office.conf.default index 4a0d9b327..4e6e83dd2 100644 --- a/config/lx_office.conf.default +++ b/config/lx_office.conf.default @@ -8,6 +8,13 @@ templates = templates # Path to the old memberfile (ignored on new installations) memberfile = users/members +[environment] +# Add the following paths to the PATH environment variable. +path = /usr/local/bin:/usr/X11R6/bin:/usr/X11/bin +# Add the following paths to the PERL5LIB environment variable. +# "/sw/lib/perl5" is for Mac OS X with Fink's Perl. +lib = /sw/lib/perl5 + [task_server] # User name to use for database access login = mb @@ -96,4 +103,4 @@ watch_form = 0 keep_temp_files = 0 # The file name where the debug messages are written to. -file_name = /tmp/lx-office-debug.log +file_name = /tmp/mb-lxdebug.log -- 2.20.1