allow VREF code to print to STDOUT...
Using a g2-style "chained update hook" as a VREF doesn't *quite* work: - all STDOUT from the hook is lost - worse, all lines get parsed as a ref followed by a message, and if the ref doesn't look like a ref it dies So now we do all this only if the message starts with 'VREF/'. Any other output is just printed out as is.
This commit is contained in:
parent
88c8d774d0
commit
850882c1a6
2 changed files with 24 additions and 13 deletions
|
@ -66,6 +66,12 @@ sub check_vrefs {
|
|||
|
||||
open( my $fh, "-|", $pgm, @_, $vref, @args ) or _die "$vref: can't spawn helper program: $!";
|
||||
while (<$fh>) {
|
||||
# print non-vref lines and skip processing (for example,
|
||||
# normal STDOUT by a normal update hook)
|
||||
unless (m(^VREF/)) {
|
||||
print;
|
||||
next;
|
||||
}
|
||||
my ( $ref, $deny_message ) = split( ' ', $_, 2 );
|
||||
check_vref( $aa, $ref, $deny_message );
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue