1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-03-03 14:52:21 +02:00

Test release version using change-log.xml instead of CHANGELOG.md.

This is in preparation for moving the change log to the website and removing it from Github.
This commit is contained in:
David Steele 2016-05-23 19:33:02 -04:00
parent 3af48f1d78
commit c604b6e657
3 changed files with 13 additions and 28 deletions

View File

@ -17,7 +17,6 @@ use File::Basename qw(dirname);
use Getopt::Long qw(GetOptions);
use Pod::Usage qw(pod2usage);
use Storable;
use XML::Checker::Parser;
use lib dirname($0) . '/lib';
use BackRestDoc::Common::Doc;

View File

@ -12,6 +12,8 @@ use Carp qw(confess);
use File::Basename qw(dirname);
use Scalar::Util qw(blessed);
use XML::Checker::Parser;
use lib dirname($0) . '/../lib';
use pgBackRest::Common::Log;
use pgBackRest::Common::String;
@ -72,15 +74,7 @@ sub new
else
{
my $oParser = XML::Checker::Parser->new(ErrorContext => 2, Style => 'Tree');
if (-e dirname($0) . '/dtd')
{
$oParser->set_sgml_search_path(dirname($0) . '/dtd')
}
else
{
$oParser->set_sgml_search_path(dirname($0) . '/xml/dtd');
}
$oParser->set_sgml_search_path(dirname($self->{strFileName}) . '/dtd', dirname($self->{strFileName}) . '/xml/dtd');
my $oTree;

View File

@ -30,6 +30,9 @@ use pgBackRest::Db;
use pgBackRest::FileCommon;
use pgBackRest::Version;
use lib dirname($0) . '/../doc/lib';
use BackRestDoc::Common::Doc;
use lib dirname($0) . '/lib';
use pgBackRestTest::BackupTest;
use pgBackRestTest::Common::ExecuteTest;
@ -207,30 +210,19 @@ if ($bVmBuild)
}
####################################################################################################################################
# Make sure version number matches in the change log.
# Make sure version number matches the latest release
####################################################################################################################################
my $hReadMe;
my $strLine;
my $bMatch = false;
my $strChangeLogFile = abs_path(dirname($0) . '/../CHANGELOG.md');
my $strReleaseFile = dirname(dirname($0)) . '/doc/xml/change-log.xml';
my $oReleaseDoc = new BackRestDoc::Common::Doc($strReleaseFile);
if (!open($hReadMe, '<', $strChangeLogFile))
foreach my $oRelease ($oReleaseDoc->nodeGet('changelog')->nodeList('changelog-release'))
{
confess "unable to open ${strChangeLogFile}";
}
while ($strLine = readline($hReadMe))
{
if ($strLine =~ /^\#\# v/)
if ($oRelease->paramGet('version') ne BACKREST_VERSION)
{
$bMatch = substr($strLine, 4, length(BACKREST_VERSION)) eq BACKREST_VERSION;
last;
confess 'unable to find version ' . BACKREST_VERSION . " as the most recent release in ${strReleaseFile}";
}
}
if (!$bMatch)
{
confess 'unable to find version ' . BACKREST_VERSION . " as last revision in ${strChangeLogFile}";
last;
}
eval