openssl/dev/release-aux/fixup-CHANGES.md-postrelease.pl
Tomas Mraz 0d4c52320d Fix fixup postrelease scripts to avoid creating errors
Otherwise the NEWS.md and CHANGES.md will contain trailing spaces.

Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17304)

(cherry picked from commit 132ab70fd8)
2021-12-20 10:13:50 +01:00

29 lines
719 B
Perl

#! /usr/bin/env perl -pi
BEGIN {
our $count = 1; # Only the first one
our $RELEASE = $ENV{RELEASE};
our $RELEASE_TEXT = $ENV{RELEASE_TEXT};
our $PREV_RELEASE_DATE = $ENV{PREV_RELEASE_DATE} || 'xx XXX xxxx';
our $PREV_RELEASE_TEXT = $ENV{PREV_RELEASE_TEXT};
$RELEASE =~ s/-dev//;
}
if (/^### Changes between (\S+) and (\S+) \[xx XXX xxxx\]/
&& $count-- > 0) {
my $v1 = $1;
my $v2 = $PREV_RELEASE_TEXT || $2;
# If this is a pre-release, we do nothing
if ($RELEASE !~ /^\d+\.\d+\.\d+-(?:alpha|beta)/) {
$_ = <<_____
### Changes between $v2 and $RELEASE_TEXT [xx XXX xxxx]
* none yet
### Changes between $v1 and $v2 [$PREV_RELEASE_DATE]
_____
}
}