1
0
mirror of synced 2026-05-08 08:42:37 +00:00

HCFILES added filtering and logging details (#2567)

* Add reporting of filtering "Why?"
Add reporting of the actual error Condition on files that FAIL.
Change extraction of the "hcfiles-fails.txt" to a perl program since the Condition reporting sometimes is multiple lines.

* Change running of the getFails.pl that extracts FAIL information.
Also check if perl is installed, and report it if not into the fails file.
This commit is contained in:
Matt Heffron
2026-04-29 11:45:47 -07:00
committed by GitHub
parent 47dd8edf60
commit cbea9a7c9d
4 changed files with 186 additions and 85 deletions

View File

@@ -57,7 +57,12 @@ main() {
# save dribble file to loadups; extract and save fails
"${MEDLEYDIR}"/scripts/cpv ${logindir}/HCFILES.DRIBBLE "${MEDLEYDIR}"/loadups/hcfiles.dribble
grep "IL:FAIL" < "${MEDLEYDIR}"/loadups/hcfiles.dribble > ${logindir}/fails
if [ -f "$(command -v perl)" ] && [ -x "$(command -v perl)" ]
then
perl "${MEDLEYDIR}"/scripts/getFails.pl '^[^\n]*IL:FAIL' 'DONE' "${MEDLEYDIR}"/loadups/hcfiles.dribble > ${logindir}/fails
else
echo Unable to extract FAIL information from "${MEDLEYDIR}"/loadups/hcfiles.dribble > ${logindir}/fails
fi
"${MEDLEYDIR}"/scripts/cpv ${logindir}/fails "${MEDLEYDIR}"/loadups/hcfiles-fails.txt
# cleanup

31
scripts/getFails.pl Normal file
View File

@@ -0,0 +1,31 @@
#!/usr/bin/env perl
use strict;
use warnings;
die "Usage: $0 <pattern1> <pattern2> [file...]\n" unless @ARGV >= 2;
my $pat1 = shift;
my $pat2 = shift;
my $regex1line = qr/${pat1}.*?${pat2}/; # all on 1 line
my $regexStart = qr/${pat1}/; # the line has the start pattern
my $regexEnd = qr/${pat2}/; # the line has the end pattern
my $flag = 0;
while (<>) {
if ($flag) { # we're in a multi-line block
print;
if (/$regexEnd/) { # does this line end the multi-line block?
$flag = 0;
print "\n"; # separator
};
}
elsif (/$regex1line/) { # all on 1 line
print;
print "\n"; # separator
}
elsif (/$regexStart/) { # begin a multi-line block
print;
$flag = 1;
}
}