pass verbosity to hook-listener

This commit is contained in:
Johannes 'josch' Schauer 2020-11-13 22:37:53 +01:00
parent e71487af5e
commit 21a26b5dac
Signed by untrusted user: josch
GPG key ID: F2CBA5C78FBD83E1
2 changed files with 4 additions and 3 deletions

View file

@ -2078,7 +2078,7 @@ mkdir /tmp/root/real
run_testA() {
echo content > /tmp/foo
{ { { $CMD --hook-helper /tmp/root root setup env 1 upload /tmp/foo \$1 < /tmp/myfifo 3>&-; echo \$? >&3; printf "\\000\\000adios";
} | $CMD --hook-listener 3>&- >/tmp/myfifo; echo \$?; } 3>&1;
} | $CMD --hook-listener 1 3>&- >/tmp/myfifo; echo \$?; } 3>&1;
} | { read xs1; [ "\$xs1" -eq 0 ]; read xs2; [ "\$xs2" -eq 0 ]; }
echo content | diff -u - /tmp/root/real/foo
rm /tmp/foo

View file

@ -3295,6 +3295,7 @@ sub hooklistener {
# errors without goto labels or much code duplication: the error handler
# has to send an "error" message to the other side
eval {
$verbosity_level = $ARGV[1];
while (1) {
# get the next message
my $msg = "error";
@ -3955,7 +3956,7 @@ sub main() {
# this is the counterpart to --hook-helper and will receive and carry
# out its instructions
if (scalar @ARGV == 1 && $ARGV[0] eq "--hook-listener") {
if (scalar @ARGV == 2 && $ARGV[0] eq "--hook-listener") {
hooklistener();
exit 0;
}
@ -5316,7 +5317,7 @@ sub main() {
if ($is_covering) {
@prefix = ($EXECUTABLE_NAME, "-MDevel::Cover=-silent,-nogcov");
}
exec @prefix, $PROGRAM_NAME, "--hook-listener";
exec @prefix, $PROGRAM_NAME, "--hook-listener", $verbosity_level;
}
waitpid($lpid, 0);
if ($? != 0) {