Skip to content

Commit

Permalink
added LC_ALL='C' locale setting, added --Exclude-mod-regex
Browse files Browse the repository at this point in the history
git-svn-id: file:///home/mbr/svn/fwsnort_repos/fwsnort/trunk@417 af5c991a-1414-0410-86ad-c3437102cd4a
  • Loading branch information
mrash committed Jan 15, 2008
1 parent eff7fc3 commit ae8cc87
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
@@ -1,3 +1,8 @@
fwsnort-1.0.4 (01//2008):
- Updated install.pl to set the LC_ALL environmental variable to "C". This
should fix potential locale problems (this fix was borrowed from the
fwknop project).

fwsnort-1.0.3 (11/22/2007):
- Added --include-re-caseless and --exclude-re-caseless options to have
--include-regex and --exclude-regex options match case insensitively.
Expand Down
27 changes: 23 additions & 4 deletions install.pl
Expand Up @@ -67,8 +67,11 @@
### establish some defaults
my $uninstall = 0;
my $cmdline_force_install = 0;
my $force_install_re = '';
my $force_mod_re = '';
my $exclude_mod_re = '';
my $help = 0;
my $locale = 'C'; ### default LC_ALL env variable
my $no_locale = 0;

my $src_dir = getcwd() or die "[*] Could not get current working directory.";

Expand All @@ -85,13 +88,22 @@

&usage(1) unless (GetOptions(
'force-mod-install' => \$cmdline_force_install, ### force install of all modules
'Force-mod-regex=s' => \$force_install_re, ### force specific mod install with regex
'Force-mod-regex=s' => \$force_mod_re, ### force specific mod install with regex
'Exclude-mod-regex=s' => \$exclude_mod_re, ### exclude a particular perl module
'uninstall' => \$uninstall, ### uninstall fwsnort
'LC_ALL=s' => \$locale,
'no-LC_ALL' => \$no_locale,
'help' => \$help
));

&usage(0) if $help;

### set LC_ALL env variable
$ENV{'LC_ALL'} = $locale unless $no_locale;

$force_mod_re = qr|$force_mod_re| if $force_mod_re;
$exclude_mod_re = qr|$exclude_mod_re| if $exclude_mod_re;

### make sure the system binaries are where we think they are.
&check_commands();

Expand Down Expand Up @@ -200,6 +212,11 @@ ()
die '[*] Missing mod-dir key in required_perl_modules hash.'
unless defined $required_perl_modules{$mod_name}{'mod-dir'};

if ($exclude_mod_re and $exclude_mod_re =~ /$mod_name/) {
print "[+] Excluding installation of $mod_name module.\n";
return;
}

my $version = '(NA)';

my $mod_dir = $required_perl_modules{$mod_name}{'mod-dir'};
Expand All @@ -221,7 +238,7 @@ ()
### install regardless of whether the module may already be
### installed
$install_module = 1;
} elsif ($force_install_re and $force_install_re =~ /$mod_name/) {
} elsif ($force_mod_re and $force_mod_re =~ /$mod_name/) {
print "[+] Forcing installation of $mod_name module.\n";
$install_module = 1;
} else {
Expand Down Expand Up @@ -450,12 +467,14 @@ ()
sub usage() {
my $exit = shift;
print <<_HELP_;
install.pl: [-F] [-f] [-u] [-h]
install.pl: [options]
-f, --force-mod-install - Install all perl modules regardless
of whether they already installed on
the system.
-F, --Force-mod-regex <regex> - Install perl module that matches a
specific regular expression.
-E, --Exclude-mod-regex <re> - Exclude a perl module that matches this
regular expression.
-u, --uninstall - uninstall fwsnort
-h, --help - print help and exit
_HELP_
Expand Down

0 comments on commit ae8cc87

Please sign in to comment.