We will need this because when runvar access is restricted, accessing
via %r directly won't work. We want to see what patterns the code is
interested in (so that interest in a nonexistent runvar is properly
tracked).
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
store_runvar get_runvar get_runvar_maybe
get_runvar_default need_runvars
unique_incrementing_runvar next_unique_name
- stashfilecontents runvar_is_synth
+ stashfilecontents runvar_is_synth runvar_glob
target_cmd_root_status target_cmd_output_root_status
target_cmd_root target_cmd target_cmd_build
Carp::cluck $m;
}
+sub runvar_glob {
+ my $monitor = tied %r;
+ my $realr = $monitor || \%r;
+ my @out;
+ foreach my $pat (@_) {
+ if ($monitor) { runvar_access_check($pat, 'scan') }
+ foreach my $key (sort keys %$realr) {
+ next unless fnmatch $pat, $key;
+ push @out, $key;
+ }
+ }
+ @out;
+}
+
package RunvarMonitor;
use Carp;
use Osstest;