Changeset 1136

Show
Ignore:
Timestamp:
01/03/08 09:22:31 (11 months ago)
Author:
ask
Message:
  • Make mogadm prefer command line settings over configuration file
    settings (Derek Boonstra)
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/utils/Changes

    r1134 r1136  
     1  * Make mogadm prefer command line settings over configuration file 
     2    settings (Derek Boonstra) 
     3 
    14  * Wire up fsck_reset's startpos argument. (Robin H. Johnson). 
    25 
  • trunk/utils/mogadm

    r1134 r1136  
    247247# load up our config files 
    248248my %opts; 
    249 my @configs = ($opts{config}, "$ENV{HOME}/.mogilefs.conf", "/etc/mogilefs/mogilefs.conf"); 
    250 foreach my $fn (reverse @configs) { 
    251     next unless $fn && -e $fn; 
    252     open FILE, "<$fn" 
    253         or die "unable to open $fn: $!\n"; 
    254     while (<FILE>) { 
    255         s/\#.*//; 
    256         next unless m!^\s*(\w+)\s*=\s*(.+?)\s*$!; 
    257         $opts{$1} = $2; 
    258     } 
    259     close FILE; 
    260 } 
    261249 
    262250Getopt::Long::Configure("require_order", "pass_through"); 
     
    269257    ) or abortWithUsage(); 
    270258Getopt::Long::Configure("require_order", "no_pass_through"); 
     259 
     260my @configs = ($opts{config}, "$ENV{HOME}/.mogilefs.conf", "/etc/mogilefs/mogilefs.conf"); 
     261foreach my $fn (reverse @configs) { 
     262    next unless $fn && -e $fn; 
     263    open FILE, "<$fn" 
     264        or die "unable to open $fn: $!\n"; 
     265    while (<FILE>) { 
     266        s/\#.*//; 
     267        next unless m!^\s*(\w+)\s*=\s*(.+?)\s*$!; 
     268        $opts{$1} = $2 unless ( defined $opts{$1} ); 
     269    } 
     270    close FILE; 
     271} 
    271272 
    272273# bail for help