Skip to content

Commit

Permalink
add --disable-perllib-envvar
Browse files Browse the repository at this point in the history
This varaible allow the user to ignore PERLLIB and PERL5LIB envvar
  • Loading branch information
Gonéri Le Bouder committed May 31, 2010
1 parent 048c1f9 commit 9b0c512
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Changes
Expand Up @@ -61,7 +61,8 @@ Revision history for FusionInventory::Agent
* HP-UX: HP Management Processor (MP) (Management Interface of HP
Integrity servers) (Amir PAKDEL)
* Collect Batteries information

* Add --disable-perllib-envvar to be able to ignore PERLLIB and
PERL5LIB envvar

2.0.6
* Fix DRIVES/CREATEDATE for ext* filesystem
Expand Down
14 changes: 14 additions & 0 deletions fusioninventory-agent
Expand Up @@ -27,6 +27,9 @@ foreach (@ARGV) {
if (/^--devlib$/) {
print "[info] --devlib are found, Developer mode enabled\n";
eval "use lib 'lib';";
} elsif (/^--disable-perllib-envvar$/) {
$ENV{PERL5LIB}=undef;
$ENV{PERLLIB}=undef;
}
}

Expand Down Expand Up @@ -172,6 +175,9 @@ on the system. Instead it will scan the ./lib directory.
It may also be useful if you don't want to install the agent on
your system.
This option can only be used as command line argument. It will be
ignored if you set it in a config file or in Windows registry.
=item B<--delaytime=SECONDS_TO_WAIT>
This option defaults to waiting a random() time between 0 and 3600 before
Expand All @@ -181,6 +187,14 @@ it's random setting. Useful for pre-setting a deployed agent's initial
start time (so you don't jam the server all at once, but don't have to
wait an hour to make sure the deployment worked).
=item B<--disable-perllib-envvar>
Do not use PERL5LIB and PERLLIB environment variable to find Perl library
path.
This option can only be used as command line argument. It will be
ignored if you set it in a config file or in Windows registry.
=item B<-f>, B<--force>
The agent ask first the server if it should send an inventoroy of the
Expand Down
5 changes: 5 additions & 0 deletions lib/FusionInventory/Agent/Config.pm
Expand Up @@ -17,6 +17,7 @@ my $default = {
'daemon-no-fork' => 0,
'debug' => 0,
'devlib' => 0,
'disable-perllib-envvar' => 0,
'force' => 0,
'help' => 0,
'html-dir' => '',
Expand Down Expand Up @@ -158,6 +159,7 @@ sub loadUserParams {
"D|daemon-no-fork"=> \$config->{'daemon-no-fork'},
"debug" => \$config->{debug},
"devlib" => \$config->{devlib},
"disable-perllib-envvar" => \$config->{'disable-perllib-envvar'},
"f|force" => \$config->{force},
"h|help" => \$config->{help},
"html-dir=s" => \$config->{'html-dir'},
Expand Down Expand Up @@ -231,6 +233,9 @@ sub help {
print STDERR "\t --delaytime set a max delay time (in second) if".
" no PROLOG_FREQ is set (".$config->{delaytime}.")\n";
print STDERR "\t --devlib search for Backend mod in ./lib only (".$config->{devlib}.")\n";
print STDERR "\t --disable-perllib-envvar do not load Perl lib ".
"from PERL5LIB and PERLIB environment variable ".
" (".$config->{'disable-perllib-envvar'}.")\n";
print STDERR "\t-f --force always send data to server (Don't ask before) (".$config->{force}.")\n";
print STDERR "\t --html-dir alternative directory where the ".
"static HTML are stored\n";
Expand Down

0 comments on commit 9b0c512

Please sign in to comment.