# other things, this lets us use gpgv everywhere, for paranoia's sake.
#
-=item $ops = interpret_directive ( $directive )
+=item $oplist = interpret_directive ( $directive )
Analyze the elements in DIRECTIVE, performing basic validation. An
exception is thrown if DIRECTIVE contains invalid element values.
my $directive = shift; # presumed tainted
my $directive_file_contents = shift; # temporary scaffold
- my %header = ( package => undef, directory => undef, version => undef );
- my @ops;
+ my %options = ( replace => undef );
+ my %header = ( version => undef, options => \%options,
+ package => undef, directory => undef );
+ my @ops = ([header => \%header]);
my $have_install = 0; # can only install one file per directive
my $filename;
my $cnt = 0; # TODO: remove this
$tainted_val =~ /^(true|false)$/
or fatal("invalid parameters for replace command: $tainted_val",
1,$directive_file_contents);
- push @ops, [set => replace => ($1 eq 'true')];
+ $options{replace} = ($1 eq 'true');
$info{"replace"} = $1; #ok.
} elsif ($tainted_cmd eq 'comment') {
# Comments are ok, we ignore them
} elsif (IN_TEST_MODE && $tainted_cmd eq 'no-op') {
# The testsuite uses a no-op command to validate directive processing.
+ push @ops, ['no-op'];
$info{'no-op'} = {order => $cnt++};
} else {
fatal("Invalid directive line:\n\n $tainted_cmd $tainted_val",
{ push @ops, [install => $filename]; $have_install = 1 }
}
- unshift @ops, [header => \%header];
-
return \@ops;
}