Option for extra perl module search paths
authorJamie Cameron <jcameron@webmin.com>
Fri, 20 Mar 2009 18:05:28 +0000 (18:05 +0000)
committerJamie Cameron <jcameron@webmin.com>
Fri, 20 Mar 2009 18:05:28 +0000 (18:05 +0000)
miniserv.pl
usermin/CHANGELOG
usermin/change_os.cgi
usermin/edit_os.cgi
webmin/CHANGELOG
webmin/change_os.cgi
webmin/edit_os.cgi
webmin/lang/en

index db13f6f..9a0361c 100755 (executable)
@@ -21,6 +21,10 @@ else {
        $config_file = "$pwd/$ARGV[0]";
        }
 %config = &read_config_file($config_file);
+if ($config{'perllib'}) {
+       push(@INC, split(/:/, $config{'perllib'}));
+       $ENV{'PERLLIB'} .= ':'.$config{'perllib'};
+       }
 
 # Check is SSL is enabled and available
 if ($config{'ssl'}) {
@@ -2020,6 +2024,7 @@ if (&get_type($full) eq "internal/cgi" && $validated != 4) {
        $envpath = $ENV{"PATH"};
        $envlang = $ENV{"LANG"};
        $envroot = $ENV{"SystemRoot"};
+       $envperllib = $ENV{'PERLLIB'};
        foreach my $k (keys %ENV) {
                delete($ENV{$k});
                }
@@ -2028,6 +2033,7 @@ if (&get_type($full) eq "internal/cgi" && $validated != 4) {
        $ENV{"USER"} = $envuser if ($envuser);
        $ENV{"OLD_LANG"} = $envlang if ($envlang);
        $ENV{"SystemRoot"} = $envroot if ($envroot);
+       $ENV{'PERLLIB'} = $envperllib if ($envperllib);
        $ENV{"HOME"} = $user_homedir;
        $ENV{"SERVER_SOFTWARE"} = $config{"server"};
        $ENV{"SERVER_NAME"} = $host;
index 1102e32..e020f86 100644 (file)
@@ -43,3 +43,5 @@ Converted commands in the module's API file to POD format, and added more detail
 ---- Changes since 1.450 ----
 Added a field for allowed SSL cipher types.
 Expired passwords can now be changed using an external command, instead of PAM or directly updating /etc/shadow. This is set on the Authentication page.
+---- Changes since 1.470 ----
+Added a field to the Operating System and Environment page for additional Perl module directories.
index c86d371..b68440a 100755 (executable)
@@ -47,6 +47,7 @@ for($i=0; defined($n = $in{"name_$i"}); $i++) {
        $miniserv{'env_'.$n} = $in{"value_$i"}
                if ($n ne "WEBMIN_CONFIG" && $n ne "WEBMIN_VAR");
        }
+$miniserv{'perllib'} = join(':', split(/\r?\n/, $in{'perllib'}));
 &put_usermin_miniserv_config(\%miniserv);
 &unlock_file($usermin_miniserv_config);
 &restart_usermin_miniserv();
index 4bfe4b4..10d88d4 100755 (executable)
@@ -63,8 +63,12 @@ if ($uconfig{'ld_env'}) {
                  5, 30));
         }
 
+# Perl search path
+print &ui_table_row($text{'os_perllib'},
+       &ui_textarea("perllib",
+            join("\n", split(":", $miniserv{'perllib'})), 3, 30));
+
 # Global environment variables
-&get_miniserv_config(\%miniserv);
 $atable = &ui_columns_start([ $text{'os_name'},
                               $text{'os_value'} ]);
 $i = 0;
index 4fa0737..f962687 100644 (file)
@@ -90,3 +90,5 @@ Added GPG verification of the updates list and modules from the Webmin update re
 Expired Unix passwords can now be changed using an external command, instead of PAM or directly updating /etc/shadow. This is set on the Authentication page.
 ---- Changes since 1.460 ----
 Detect and ignore failures when checking if other modules are installed.
+---- Changes since 1.470 ----
+Added a field to the Operating System and Environment page for additional Perl module directories.
index 3277f57..f18a41e 100755 (executable)
@@ -48,6 +48,7 @@ for($i=0; defined($n = $in{"name_$i"}); $i++) {
        $miniserv{'env_'.$n} = $in{"value_$i"}
                if ($n ne "WEBMIN_CONFIG" && $n ne "WEBMIN_VAR");
        }
+$miniserv{'perllib'} = join(':', split(/\r?\n/, $in{'perllib'}));
 &put_miniserv_config(\%miniserv);
 &unlock_file($ENV{'MINISERV_CONFIG'});
 
index 0c84d6f..93954c5 100755 (executable)
@@ -4,6 +4,7 @@
 
 require './webmin-lib.pl';
 &ui_print_header(undef, $text{'os_title'}, "");
+&get_miniserv_config(\%miniserv);
 
 print $text{'os_desc3'},"<br>\n";
 print $text{'os_desc2'},"<p>\n";
@@ -57,8 +58,12 @@ if ($gconfig{'ld_env'}) {
                     5, 30));
        }
 
+# Perl search path
+print &ui_table_row($text{'os_perllib'},
+       &ui_textarea("perllib",
+            join("\n", split(":", $miniserv{'perllib'})), 3, 30));
+
 # Global environment variables
-&get_miniserv_config(\%miniserv);
 $atable = &ui_columns_start([ $text{'os_name'}, $text{'os_value'} ]);
 $i = 0;
 foreach $e (keys %miniserv) {
index 2e76b3c..82142fd 100644 (file)
@@ -276,6 +276,7 @@ os_new=New operating system
 os_path=Program search path
 os_syspath=Include system's own search path?
 os_ld_path=Library search path
+os_perllib=Extra Perl library paths
 os_envs=Additional environment variables
 os_name=Variable name
 os_value=Value