/[libconf]/libconf/perl-Libconf/templates/resolv_template.pm
ViewVC logotype

Diff of /libconf/perl-Libconf/templates/resolv_template.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by dams, Tue Apr 22 23:03:57 2003 UTC revision 1.6 by dams, Thu May 29 18:08:17 2003 UTC
# Line 46  $templates{resolv} = { Line 46  $templates{resolv} = {
46                                         }                                         }
47                                       ),                                       ),
48                                       q(                                       q(
49                                         if ($in =~ s/^\s*search\s+(.+)\s*$//) {                                         if ($in =~ s/^\s*search\s+(.+\S)\s*$//) {
50                                             $atom->{type} = 'LIST';                                             $atom->{type} = 'LIST';
51                                             $atom->{type2} = 'RESOLV_SEARCH';                                             $atom->{type2} = 'RESOLV_SEARCH';
52                                             $atom->{list} = [ split(' ', $1) ];                                             $atom->{list} = [ split(' ', $1) ];
# Line 55  $templates{resolv} = { Line 55  $templates{resolv} = {
55                                         }                                         }
56                                       ),                                       ),
57                                       q(                                       q(
58                                         if ($in =~ s/^\s*sortlist\s+(.+)\s*$//) {                                         if ($in =~ s/^\s*sortlist\s+(.+\S)\s*$//) {
59                                             $atom->{type} = 'LIST';                                             $atom->{type} = 'LIST';
60                                             $atom->{type2} = 'RESOLV_SORTLIST';                                             $atom->{type2} = 'RESOLV_SORTLIST';
61                                             $atom->{list} = [ split(' ', $1) ];                                             $atom->{list} = [ split(' ', $1) ];
# Line 64  $templates{resolv} = { Line 64  $templates{resolv} = {
64                                         }                                         }
65                                       ),                                       ),
66                                       q(                                       q(
67                                         if ($in =~ s/^\s*options\s+(.+)\s*$//) {                                         if ($in =~ s/^\s*options\s+(.+\S)\s*$//) {
68                                             $atom->{type} = 'LIST';                                             $atom->{type} = 'LIST';
69                                             $atom->{type2} = 'RESOLV_OPTIONS';                                             $atom->{type2} = 'RESOLV_OPTIONS';
70                                             $atom->{list} = [ map { /([^:]+):([^:]+)/ ? { $1 => $2 } : $_ } split(' ', $1) ];                                             $atom->{list} = [ map { /([^:]+):([^:]+)/ ? { $1 => $2 } : $_ } split(' ', $1) ];
# Line 74  $templates{resolv} = { Line 74  $templates{resolv} = {
74                                       ),                                       ),
75                                      ],                                      ],
76                             comments => [ ['#'] ],                             comments => [ ['#'] ],
                            comment_output => q(/^(\s*)$/ ? "$_\n" : "#$_\n"),  
77                             output => {                             output => {
78                                        VALUE => q(                                        VALUE => q(
79                                              my $temp = lc($atom->{type2});                                              my $temp = lc($atom->{type2});
80                                              $temp =~ s/resolv_//;                                              $temp =~ s/resolv_//;
81                                              "$temp " . $atom->{value} . "\n";                                              $output_text = "$temp " . $atom->{value};
82                                        ),                                        ),
83                                        LIST => q(                                        LIST => q(
84                                              if ($atom->{type2} eq 'RESOLV_SEARCH') {                                              if ($atom->{type2} eq 'RESOLV_SEARCH') {
85                                                  join(' ', 'search', @{$atom->{list}}) . "\n";                                                  $output_text = join(' ', 'search', @{$atom->{list}});
86                                              } elsif ($atom->{type2} eq 'RESOLV_SORTLIST') {                                              } elsif ($atom->{type2} eq 'RESOLV_SORTLIST') {
87                                                  join(' ', 'sortlist', map { @$_ } @{$atom->{list}}) . "\n";                                                  $output_text = join(' ', 'sortlist', map { @$_ } @{$atom->{list}});
88                                              } elsif ($atom->{type2} eq 'RESOLV_OPTIONS') {                                              } elsif ($atom->{type2} eq 'RESOLV_OPTIONS') {
89                                                  join(' ', 'sortlist', map { ref($_) ? $_->[0] . ':' . $_->[1] : $_ } @{$atom->{list}}) . "\n";                                                  $output_text = join(' ', 'sortlist', map { ref($_) ? $_->[0] . ':' . $_->[1] : $_ } @{$atom->{list}});
90                                              }                                              }
91                                        ),                                        ),
92                                       },                                       },

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26