use POSIX qw(strftime);
require "$ENV{srcdir}/doc/mk.util.pm";

my $ch    = util::tryopen( grep m,changes.txt,, @ARGV );
my $tst   = util::tryopen( grep m,test.txt,, @ARGV );
my $today = strftime "%Y-%m-%d", localtime;

print OUT <<EOF;
# status

Patches from ‹next› that pass the testsuite are automatically promoted to
‹current›. The latest batch was considered on «$today», with the following
results.

EOF

if ( $ch )
{
    print OUT "# new patches\n\n";
    print OUT <$ch>;
    print OUT "\n";
}

if ( $tst )
{
    print OUT "# test results\n\n";
    print OUT <$tst>;
    print OUT "\n";
}

print STDERR "$ch\n";
