- Timestamp:
- Aug 30, 2017, 5:07:33 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb/lib/ProjectBuilder/Filter.pm
r2251 r2253 68 68 my $pbos = shift; 69 69 my $ptr = undef; # returned value pointer on the hash of filters 70 my %h;70 my $h; 71 71 72 72 pb_log(2,"Entering pb_get_filters - pbpkg: $pbpkg - pbos: ".Dumper($pbos)."\n"); … … 88 88 foreach my $f (@ffiles) { 89 89 pb_log(3,"DEBUG processing filter file $f\n"); 90 open(CONF,$f) || next; 91 while(<CONF>) { 92 if (/^\s*([A-z0-9-_]+)\s+([[A-z0-9-_]+)\s*=\s*(.+)$/) { 93 my ($what, $var, $value) = ($1, $2, $3); 94 pb_log(3,"DEBUG creating entry $what, key $var, value $value\n"); 95 # Add support for multi-lines 96 while ($value =~ s/\\\s*$//o) { 97 $_ = <CONF>; 98 die "Still processing continuations for $what $var at EOF" if (not defined $_); 99 s/[\r\n]//go; 100 $value .= "\n$_"; 101 } 102 $h{$what}{$var}=$value; 103 } elsif ((/^\s*#/o) || (/^\s*$/o)) { 104 # ignore 105 } else { 106 chomp(); 107 warn "unexpected line '$_' in $f"; 108 } 109 } 110 close(CONF); 111 } 112 $ptr = $h{"filter"}; 90 $h = pb_conf_cache($f,$h); 91 } 92 $ptr = $h->{"filter"}; 113 93 114 94 # TODO: find a place to document it. Why not in this file as pod and also documenting filters ? 115 95 # Handle transform 116 if (defined $h {transform}) {117 while (my ($out_key,$spec) = each %{$h {transform}}) {96 if (defined $h->{transform}) { 97 while (my ($out_key,$spec) = each %{$h->{transform}}) { 118 98 die "Unknown transform for $out_key '$spec' expected <out-key> <transform>" unless $spec =~ /^([\w\-]+)\s+(.+)$/; 119 99 my ($in_key, $expr) = ($1, $2);
Note:
See TracChangeset
for help on using the changeset viewer.