Changeset 239

Show
Ignore:
Timestamp:
01/10/08 21:06:28 (11 months ago)
Author:
mbr
Message:

added locale setting and --Exclude option

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • gpgdir/trunk/CREDITS

    r224 r239  
    3333    - Suggested the --Symmetric option so that files can be encrypted/ 
    3434      decrypted via a symmetric cipher (GnuPG supports CAST5 by default). 
     35 
     36Franck Joncourt 
     37    - Performed analysis of locale settings for fwknop installer and suggested 
     38      using the LC_ALL environmental variable instead of the LANG variable 
     39      (which is superseded by LC_* vars). 
  • gpgdir/trunk/install.pl

    r193 r239  
    99# Author: Michael Rash (mbr@cipherdyne.org) 
    1010# 
    11 # Copyright (C) 2002-2007 Michael Rash (mbr@cipherdyne.org) 
     11# Copyright (C) 2002-2008 Michael Rash (mbr@cipherdyne.org) 
    1212# 
    1313# License (GNU Public License): 
     
    4949my $print_help = 0; 
    5050my $uninstall  = 0; 
    51 my $force_install_re  = ''; 
     51my $force_mod_re  = ''; 
     52my $exclude_mod_re  = ''; 
    5253my $skip_module_install   = 0; 
    5354my $cmdline_force_install = 0; 
     55my $locale = 'C';  ### default LC_ALL env variable 
     56my $no_locale = 0; 
    5457 
    5558my %cmds = ( 
     
    8083&usage(1) unless (GetOptions( 
    8184    'force-mod-install' => \$cmdline_force_install,  ### force install of all modules 
    82     'Force-mod-regex=s' => \$force_install_re,  ### force specific mod install with regex 
     85    'Force-mod-regex=s' => \$force_mod_re,  ### force specific mod install with regex 
     86    'Exclude-mod-regex=s' => \$exclude_mod_re, ### exclude a particular perl module 
    8387    'Skip-mod-install'  => \$skip_module_install, 
    8488    'home-dir=s'        => \$config_homedir, ### force a specific home dir 
     89    'LC_ALL=s'          => \$locale, 
     90    'no-LC_ALL'         => \$no_locale, 
    8591    'uninstall' => \$uninstall,      # Uninstall gpgdir. 
    8692    'help'      => \$print_help      # Display help. 
    8793)); 
    8894&usage(0) if $print_help; 
     95 
     96### set LC_ALL env variable 
     97$ENV{'LC_ALL'} = $locale unless $no_locale; 
     98 
     99$force_mod_re = qr|$force_mod_re| if $force_mod_re; 
     100$exclude_mod_re = qr|$exclude_mod_re| if $exclude_mod_re; 
    89101 
    90102### check to see if we are installing in a Cygwin environment 
     
    200212        unless defined $required_perl_modules{$mod_name}{'mod-dir'}; 
    201213 
     214    if ($exclude_mod_re and $exclude_mod_re =~ /$mod_name/) { 
     215        print "[+] Excluding installation of $mod_name module.\n"; 
     216        return; 
     217    } 
     218 
    202219    my $version = '(NA)'; 
    203220 
     
    221238        ### installed 
    222239        $install_module = 1; 
    223     } elsif ($force_install_re and $force_install_re =~ /$mod_name/) { 
     240    } elsif ($force_mod_re and $force_mod_re =~ /$mod_name/) { 
    224241        print "[+] Forcing installation of $mod_name module.\n"; 
    225242        $install_module = 1; 
     
    405422Usage: install.pl [options] 
    406423 
    407     -u,  --uninstall            - Uninstall gpgdir. 
    408     -f, --force-mod-install     - Force all perl modules to be installed 
    409                                   even if some already exist in the system 
    410                                   /usr/lib/perl5 tree. 
    411     -F, --Force-mod-regex <re>  - Specify a regex to match a module name 
    412                                   and force the installation of such modules. 
     424    -u,  --uninstall             - Uninstall gpgdir. 
     425    -f, --force-mod-install      - Force all perl modules to be installed 
     426                                   even if some already exist in the system 
     427                                   /usr/lib/perl5 tree. 
     428    -F, --Force-mod-regex <re>   - Specify a regex to match a module name 
     429                                   and force the installation of such modules. 
     430    -E, --Exclude-mod-regex <re> - Exclude a perl module that matches this 
     431                                   regular expression. 
    413432    -S, --Skip-mod-install       - Do not install any perl modules. 
    414     -h  --help                  - Prints this help message. 
     433 
     434    -L, --LANG <locale>          - Specify LANG env variable (actually the 
     435                                   LC_ALL variable). 
     436    -h  --help                   - Prints this help message. 
    415437 
    416438_HELP_