ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/JSOC/netdrms_setup.pl
(Generate patch)

Comparing netdrms_setup.pl (file contents):
Revision 1.1 by rick, Fri Apr 17 21:13:43 2009 UTC vs.
Revision 1.2 by arta, Wed May 6 17:54:07 2009 UTC

# Line 1 | Line 1
1 < #!perl --
1 > #!/usr/bin/perl --
2  
3   # generate config scripts rather than follow the instructions
4   # and have to look at all of variables to change around,
# Line 17 | Line 17
17   use strict;
18   use warnings;
19   use Data::Dumper;
20 + use ExtUtils::MakeMaker;
21  
22   ####
23   # before we go any further ...
# Line 72 | Line 73 | my @fields = qw (
73          SUMS_GROUP
74          SUMS_USER
75          DRMS
75
76   );
77  
78  
# Line 92 | Line 92 | GetOptions(
92  
93   my $EOL = $verbose > 2 ? '' : "\n" ;
94  
95 use ExtUtils::MakeMaker;
95   if ($noprompt) { $ENV{'PERL_MM_USE_DEFAULT'} = 1 };
96  
97   if ($verbose > 2) { print <<EOF; }
# Line 212 | Line 211 | while ( @template_file ) {
211                  $description = '';
212          }
213   }
214 <                
214 >        
215 >
216 > # are there any config options in the template that were NOT in the hard coded list?
217 > # if so, we'll need to prompt for them, too.
218 >
219 > my %known_fields = map { $_ => undef } @fields;
220 > my @unknown_fields = grep { ! exists $known_fields{$_} } keys %template_defaults;
221 >
222 > if (@unknown_fields) {
223 >        warn "Unknown field in template : @unknown_fields $EOL" if $verbose;
224 >        push @fields, @unknown_fields;
225 > }
226 >
227  
228   #####
229  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines