1
0
mirror of synced 2026-05-07 00:18:09 +00:00
Files
Interlisp.medley/scripts/getFails.pl
Matt Heffron cbea9a7c9d 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.
2026-04-29 11:45:47 -07:00

31 lines
887 B
Perl

#!/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;
}
}