From 4a5bd002c0071960b537e6d1dc35efe626146956 Mon Sep 17 00:00:00 2001 From: David Steele Date: Tue, 10 Mar 2020 17:57:02 -0400 Subject: [PATCH] Move pgBackRest::Version module to pgBackRestDoc::ProjectInfo. The primary source for project info is now src/version.h. The pgBackRestDoc::ProjectInfo module loads the project info from src/version.h at runtime so there is no need to update it. --- build/lib/pgBackRestBuild/Config/Build.pm | 3 +- .../lib/pgBackRestBuild/Config/BuildDefine.pm | 3 +- .../lib/pgBackRestBuild/Config/BuildParse.pm | 3 +- build/lib/pgBackRestBuild/Config/Data.pm | 3 +- doc/RELEASE.md | 12 ++-- doc/doc.pl | 3 +- doc/lib/pgBackRestDoc/Common/DocConfig.pm | 3 +- doc/lib/pgBackRestDoc/Common/DocExecute.pm | 3 +- doc/lib/pgBackRestDoc/Common/Ini.pm | 3 +- .../pgBackRestDoc/Custom/DocCustomRelease.pm | 3 +- doc/lib/pgBackRestDoc/Html/DocHtmlSite.pm | 3 +- doc/lib/pgBackRestDoc/Latex/DocLatex.pm | 10 ++- doc/lib/pgBackRestDoc/Markdown/DocMarkdown.pm | 3 +- doc/lib/pgBackRestDoc/ProjectInfo.pm | 69 +++++++++++++++++++ doc/manifest.xml | 2 +- doc/release.pl | 3 +- lib/pgBackRest/Version.pm | 53 -------------- .../pgBackRestTest/Common/ContainerTest.pm | 3 +- .../lib/pgBackRestTest/Common/CoverageTest.pm | 3 +- test/lib/pgBackRestTest/Common/JobTest.pm | 3 +- test/lib/pgBackRestTest/Common/LogTest.pm | 3 +- test/lib/pgBackRestTest/Common/RunTest.pm | 5 +- test/lib/pgBackRestTest/Common/StorageRepo.pm | 3 +- test/lib/pgBackRestTest/Env/ExpireEnvTest.pm | 3 +- .../pgBackRestTest/Env/Host/HostBackupTest.pm | 3 +- .../pgBackRestTest/Env/Host/HostBaseTest.pm | 3 +- .../Env/Host/HostDbCommonTest.pm | 3 +- .../Env/Host/HostDbSyntheticTest.pm | 3 +- .../lib/pgBackRestTest/Env/Host/HostDbTest.pm | 3 +- .../lib/pgBackRestTest/Env/Host/HostS3Test.pm | 3 +- .../pgBackRestTest/Module/Mock/MockAllTest.pm | 3 +- .../pgBackRestTest/Module/Real/RealAllTest.pm | 3 +- test/test.pl | 28 +------- 33 files changed, 110 insertions(+), 147 deletions(-) create mode 100644 doc/lib/pgBackRestDoc/ProjectInfo.pm delete mode 100644 lib/pgBackRest/Version.pm diff --git a/build/lib/pgBackRestBuild/Config/Build.pm b/build/lib/pgBackRestBuild/Config/Build.pm index e19dc069e..d946846f9 100644 --- a/build/lib/pgBackRestBuild/Config/Build.pm +++ b/build/lib/pgBackRestBuild/Config/Build.pm @@ -14,10 +14,9 @@ use Exporter qw(import); use File::Basename qw(dirname); use Storable qw(dclone); -use pgBackRest::Version; - use pgBackRestDoc::Common::Log; use pgBackRestDoc::Common::String; +use pgBackRestDoc::ProjectInfo; use pgBackRestBuild::Build::Common; use pgBackRestBuild::Config::BuildDefine; diff --git a/build/lib/pgBackRestBuild/Config/BuildDefine.pm b/build/lib/pgBackRestBuild/Config/BuildDefine.pm index b6f48001c..2260a0513 100644 --- a/build/lib/pgBackRestBuild/Config/BuildDefine.pm +++ b/build/lib/pgBackRestBuild/Config/BuildDefine.pm @@ -14,12 +14,11 @@ use Exporter qw(import); use File::Basename qw(dirname); use Storable qw(dclone); -use pgBackRest::Version; - use pgBackRestDoc::Common::DocConfig; use pgBackRestDoc::Common::DocRender; use pgBackRestDoc::Common::Log; use pgBackRestDoc::Common::String; +use pgBackRestDoc::ProjectInfo; use pgBackRestBuild::Build::Common; use pgBackRestBuild::Config::Data; diff --git a/build/lib/pgBackRestBuild/Config/BuildParse.pm b/build/lib/pgBackRestBuild/Config/BuildParse.pm index f22bdfd0b..26a6e8a98 100644 --- a/build/lib/pgBackRestBuild/Config/BuildParse.pm +++ b/build/lib/pgBackRestBuild/Config/BuildParse.pm @@ -14,10 +14,9 @@ use Exporter qw(import); use File::Basename qw(dirname); use Storable qw(dclone); -use pgBackRest::Version; - use pgBackRestDoc::Common::Log; use pgBackRestDoc::Common::String; +use pgBackRestDoc::ProjectInfo; use pgBackRestBuild::Build::Common; use pgBackRestBuild::Config::Build; diff --git a/build/lib/pgBackRestBuild/Config/Data.pm b/build/lib/pgBackRestBuild/Config/Data.pm index b71f42d1e..40185a664 100644 --- a/build/lib/pgBackRestBuild/Config/Data.pm +++ b/build/lib/pgBackRestBuild/Config/Data.pm @@ -66,10 +66,9 @@ use File::Basename qw(dirname basename); use Getopt::Long qw(GetOptions); use Storable qw(dclone); -use pgBackRest::Version; - use pgBackRestDoc::Common::Exception; use pgBackRestDoc::Common::Log; +use pgBackRestDoc::ProjectInfo; use pgBackRestTest::Common::Wait; diff --git a/doc/RELEASE.md b/doc/RELEASE.md index f192b98fc..2f22a3d9c 100644 --- a/doc/RELEASE.md +++ b/doc/RELEASE.md @@ -17,13 +17,13 @@ to: ``` -Edit version in `lib/pgBackRest/Version.pm`, e.g.: +Edit version in `src/version.h`, e.g.: ``` -use constant PROJECT_VERSION => '2.14dev'; +#define PROJECT_VERSION "2.14dev" ``` to: ``` -use constant PROJECT_VERSION => '2.14'; +#define PROJECT_VERSION "2.14" ``` ## Build release documentation. Be sure to install latex using the instructions from the Vagrantfile before running this step. @@ -121,13 +121,13 @@ Add new release in `doc/xml/release.xml`, e.g.: ``` -Edit version in `lib/pgBackRest/Version.pm`, e.g.: +Edit version in `src/version.h`, e.g.: ``` -use constant PROJECT_VERSION => '2.14'; +#define PROJECT_VERSION "2.14" ``` to: ``` -use constant PROJECT_VERSION => '2.15dev'; +#define PROJECT_VERSION "2.15dev" ``` Run deploy to generate git history (ctrl-c as soon as the file is generated): diff --git a/doc/doc.pl b/doc/doc.pl index 04e711d46..8c980bad9 100755 --- a/doc/doc.pl +++ b/doc/doc.pl @@ -24,8 +24,6 @@ use lib dirname(dirname(abs_path($0))) . '/lib'; use lib dirname(dirname(abs_path($0))) . '/build/lib'; use lib dirname(dirname(abs_path($0))) . '/test/lib'; -use pgBackRest::Version; - use pgBackRestTest::Common::ExecuteTest; use pgBackRestTest::Common::Storage; use pgBackRestTest::Common::StoragePosix; @@ -40,6 +38,7 @@ use pgBackRestDoc::Common::String; use pgBackRestDoc::Html::DocHtmlSite; use pgBackRestDoc::Latex::DocLatex; use pgBackRestDoc::Markdown::DocMarkdown; +use pgBackRestDoc::ProjectInfo; #################################################################################################################################### # Usage diff --git a/doc/lib/pgBackRestDoc/Common/DocConfig.pm b/doc/lib/pgBackRestDoc/Common/DocConfig.pm index 0e7e02fae..1a002aced 100644 --- a/doc/lib/pgBackRestDoc/Common/DocConfig.pm +++ b/doc/lib/pgBackRestDoc/Common/DocConfig.pm @@ -11,12 +11,11 @@ use Exporter qw(import); our @EXPORT = qw(); use File::Basename qw(dirname); -use pgBackRest::Version; - use pgBackRestBuild::Config::Data; use pgBackRestDoc::Common::Log; use pgBackRestDoc::Common::String; +use pgBackRestDoc::ProjectInfo; #################################################################################################################################### # Help types diff --git a/doc/lib/pgBackRestDoc/Common/DocExecute.pm b/doc/lib/pgBackRestDoc/Common/DocExecute.pm index dbd65da36..f44c40290 100644 --- a/doc/lib/pgBackRestDoc/Common/DocExecute.pm +++ b/doc/lib/pgBackRestDoc/Common/DocExecute.pm @@ -15,8 +15,6 @@ use Exporter qw(import); use File::Basename qw(dirname); use Storable qw(dclone); -use pgBackRest::Version; - use pgBackRestBuild::Config::Data; use pgBackRestTest::Common::ExecuteTest; @@ -28,6 +26,7 @@ use pgBackRestDoc::Common::Exception; use pgBackRestDoc::Common::Ini; use pgBackRestDoc::Common::Log; use pgBackRestDoc::Common::String; +use pgBackRestDoc::ProjectInfo; #################################################################################################################################### # User that's building the docs diff --git a/doc/lib/pgBackRestDoc/Common/Ini.pm b/doc/lib/pgBackRestDoc/Common/Ini.pm index 463826d33..25aaccb18 100644 --- a/doc/lib/pgBackRestDoc/Common/Ini.pm +++ b/doc/lib/pgBackRestDoc/Common/Ini.pm @@ -15,11 +15,10 @@ use File::Basename qw(dirname); use JSON::PP; use Storable qw(dclone); -use pgBackRest::Version; - use pgBackRestDoc::Common::Exception; use pgBackRestDoc::Common::Log; use pgBackRestDoc::Common::String; +use pgBackRestDoc::ProjectInfo; #################################################################################################################################### # Boolean constants diff --git a/doc/lib/pgBackRestDoc/Custom/DocCustomRelease.pm b/doc/lib/pgBackRestDoc/Custom/DocCustomRelease.pm index b1dec3e14..c89035a0b 100644 --- a/doc/lib/pgBackRestDoc/Custom/DocCustomRelease.pm +++ b/doc/lib/pgBackRestDoc/Custom/DocCustomRelease.pm @@ -12,13 +12,12 @@ use Exporter qw(import); our @EXPORT = qw(); use File::Basename qw(dirname); -use pgBackRest::Version; - use pgBackRestBuild::Config::Data; use pgBackRestDoc::Common::DocRender; use pgBackRestDoc::Common::Log; use pgBackRestDoc::Common::String; +use pgBackRestDoc::ProjectInfo; #################################################################################################################################### # XML node constants diff --git a/doc/lib/pgBackRestDoc/Html/DocHtmlSite.pm b/doc/lib/pgBackRestDoc/Html/DocHtmlSite.pm index 865ac5915..9d6d32933 100644 --- a/doc/lib/pgBackRestDoc/Html/DocHtmlSite.pm +++ b/doc/lib/pgBackRestDoc/Html/DocHtmlSite.pm @@ -16,8 +16,6 @@ use File::Copy; use POSIX qw(strftime); use Storable qw(dclone); -use pgBackRest::Version; - use pgBackRestTest::Common::ExecuteTest; use pgBackRestDoc::Common::DocConfig; @@ -26,6 +24,7 @@ use pgBackRestDoc::Common::Exception; use pgBackRestDoc::Common::Log; use pgBackRestDoc::Common::String; use pgBackRestDoc::Html::DocHtmlPage; +use pgBackRestDoc::ProjectInfo; #################################################################################################################################### # CONSTRUCTOR diff --git a/doc/lib/pgBackRestDoc/Latex/DocLatex.pm b/doc/lib/pgBackRestDoc/Latex/DocLatex.pm index 95a9479d5..0b8c9aa94 100644 --- a/doc/lib/pgBackRestDoc/Latex/DocLatex.pm +++ b/doc/lib/pgBackRestDoc/Latex/DocLatex.pm @@ -17,17 +17,15 @@ use File::Copy; use POSIX qw(strftime); use Storable qw(dclone); -use pgBackRest::Version; - -use pgBackRestDoc::Common::Exception; -use pgBackRestDoc::Common::Log; -use pgBackRestDoc::Common::String; - use pgBackRestTest::Common::ExecuteTest; use pgBackRestDoc::Common::DocConfig; use pgBackRestDoc::Common::DocManifest; +use pgBackRestDoc::Common::Exception; +use pgBackRestDoc::Common::Log; +use pgBackRestDoc::Common::String; use pgBackRestDoc::Latex::DocLatexSection; +use pgBackRestDoc::ProjectInfo; #################################################################################################################################### # CONSTRUCTOR diff --git a/doc/lib/pgBackRestDoc/Markdown/DocMarkdown.pm b/doc/lib/pgBackRestDoc/Markdown/DocMarkdown.pm index b5aef5042..e15735f21 100644 --- a/doc/lib/pgBackRestDoc/Markdown/DocMarkdown.pm +++ b/doc/lib/pgBackRestDoc/Markdown/DocMarkdown.pm @@ -15,8 +15,6 @@ use File::Copy; use POSIX qw(strftime); use Storable qw(dclone); -use pgBackRest::Version; - use pgBackRestTest::Common::ExecuteTest; use pgBackRestDoc::Common::DocConfig; @@ -24,6 +22,7 @@ use pgBackRestDoc::Common::DocManifest; use pgBackRestDoc::Common::Log; use pgBackRestDoc::Common::String; use pgBackRestDoc::Markdown::DocMarkdownRender; +use pgBackRestDoc::ProjectInfo; #################################################################################################################################### # CONSTRUCTOR diff --git a/doc/lib/pgBackRestDoc/ProjectInfo.pm b/doc/lib/pgBackRestDoc/ProjectInfo.pm new file mode 100644 index 000000000..ebf3b86e8 --- /dev/null +++ b/doc/lib/pgBackRestDoc/ProjectInfo.pm @@ -0,0 +1,69 @@ +#################################################################################################################################### +# PROJECT INFO MODULE +# +# Contains project name, version and format. +#################################################################################################################################### +package pgBackRestDoc::ProjectInfo; + +use strict; +use warnings FATAL => qw(all); + +use Cwd qw(abs_path); +use Exporter qw(import); + our @EXPORT = qw(); +use File::Basename qw(dirname); + +# Project Name +# +# Defines the official project name, exe, and config file. +#----------------------------------------------------------------------------------------------------------------------------------- +push @EXPORT, qw(PROJECT_NAME); +push @EXPORT, qw(PROJECT_EXE); +push @EXPORT, qw(PROJECT_CONF); + +# Project Version Number +# +# Defines the current version of the BackRest executable. The version number is used to track features but does not affect what +# repositories or manifests can be read - that's the job of the format number. +#----------------------------------------------------------------------------------------------------------------------------------- +push @EXPORT, qw(PROJECT_VERSION); + +# Repository Format Number +# +# Defines format for info and manifest files as well as on-disk structure. If this number changes then the repository will be +# invalid unless migration functions are written. +#----------------------------------------------------------------------------------------------------------------------------------- +push @EXPORT, qw(REPOSITORY_FORMAT); + +#################################################################################################################################### +# Load project info from src/version.h +#################################################################################################################################### +require pgBackRestTest::Common::Storage; +require pgBackRestTest::Common::StoragePosix; + +my $strProjectInfo = ${new pgBackRestTest::Common::Storage( + dirname(dirname(abs_path($0))), new pgBackRestTest::Common::StoragePosix())->get('src/version.h')}; + +foreach my $strLine (split("\n", $strProjectInfo)) +{ + + if ($strLine =~ /^#define PROJECT_NAME/) + { + eval("use constant PROJECT_NAME => " . (split(" ", $strLine))[-1]); + } + elsif ($strLine =~ /^#define PROJECT_BIN/) + { + eval("use constant PROJECT_EXE => " . (split(" ", $strLine))[-1]); + eval("use constant PROJECT_CONF => " . (split(" ", $strLine))[-1] . " . \'.conf\'"); + } + elsif ($strLine =~ /^#define PROJECT_VERSION/) + { + eval("use constant PROJECT_VERSION => " . (split(" ", $strLine))[-1]); + } + elsif ($strLine =~ /^#define REPOSITORY_FORMAT/) + { + eval("use constant REPOSITORY_FORMAT => " . (split(" ", $strLine))[-1]); + } +} + +1; diff --git a/doc/manifest.xml b/doc/manifest.xml index 5bacd2b68..357910708 100644 --- a/doc/manifest.xml +++ b/doc/manifest.xml @@ -5,7 +5,7 @@ pgBackRest Reliable PostgreSQL Backup & Restore - use pgBackRest::Version; PROJECT_VERSION + use pgBackRestDoc::ProjectInfo; PROJECT_VERSION use pgBackRestDoc::Custom::DocCustomRelease; diff --git a/doc/release.pl b/doc/release.pl index 7fffd0c67..fdcbda325 100755 --- a/doc/release.pl +++ b/doc/release.pl @@ -24,8 +24,6 @@ use lib dirname(dirname($0)) . '/build/lib'; use lib dirname(dirname($0)) . '/lib'; use lib dirname(dirname($0)) . '/test/lib'; -use pgBackRest::Version; - use pgBackRestTest::Common::ExecuteTest; use pgBackRestTest::Common::Storage; use pgBackRestTest::Common::StoragePosix; @@ -41,6 +39,7 @@ use pgBackRestDoc::Common::String; use pgBackRestDoc::Html::DocHtmlSite; use pgBackRestDoc::Latex::DocLatex; use pgBackRestDoc::Markdown::DocMarkdown; +use pgBackRestDoc::ProjectInfo; #################################################################################################################################### # Usage diff --git a/lib/pgBackRest/Version.pm b/lib/pgBackRest/Version.pm deleted file mode 100644 index cfa8c2769..000000000 --- a/lib/pgBackRest/Version.pm +++ /dev/null @@ -1,53 +0,0 @@ -#################################################################################################################################### -# VERSION MODULE -# -# Contains project version and format numbers. -#################################################################################################################################### -package pgBackRest::Version; - -use strict; -use warnings FATAL => qw(all); - -use Cwd qw(abs_path); -use Exporter qw(import); - our @EXPORT = qw(); - -# Project Name -# -# Defines the official project name. -#----------------------------------------------------------------------------------------------------------------------------------- -use constant PROJECT_NAME => 'pgBackRest'; - push @EXPORT, qw(PROJECT_NAME); -use constant PROJECT_EXE => lc(PROJECT_NAME); - push @EXPORT, qw(PROJECT_EXE); -use constant PROJECT_CONF => PROJECT_EXE . '.conf'; - push @EXPORT, qw(PROJECT_CONF); - -# Binary location -# -# Stores the exe location. -#----------------------------------------------------------------------------------------------------------------------------------- -my $strProjectBin; - -sub projectBin {return $strProjectBin}; -sub projectBinSet {$strProjectBin = shift} - -push @EXPORT, qw(projectBin projectBinSet); - -# Project Version Number -# -# Defines the current version of the BackRest executable. The version number is used to track features but does not affect what -# repositories or manifests can be read - that's the job of the format number. -#----------------------------------------------------------------------------------------------------------------------------------- -use constant PROJECT_VERSION => '2.25dev'; - push @EXPORT, qw(PROJECT_VERSION); - -# Repository Format Number -# -# Defines format for info and manifest files as well as on-disk structure. If this number changes then the repository will be -# invalid unless migration functions are written. -#----------------------------------------------------------------------------------------------------------------------------------- -use constant REPOSITORY_FORMAT => 5; - push @EXPORT, qw(REPOSITORY_FORMAT); - -1; diff --git a/test/lib/pgBackRestTest/Common/ContainerTest.pm b/test/lib/pgBackRestTest/Common/ContainerTest.pm index 4d4d4fb2b..a03d1272a 100755 --- a/test/lib/pgBackRestTest/Common/ContainerTest.pm +++ b/test/lib/pgBackRestTest/Common/ContainerTest.pm @@ -18,10 +18,9 @@ use Exporter qw(import); use File::Basename qw(dirname); use Getopt::Long qw(GetOptions); -use pgBackRest::Version; - use pgBackRestDoc::Common::Log; use pgBackRestDoc::Common::String; +use pgBackRestDoc::ProjectInfo; use pgBackRestTest::Common::ExecuteTest; use pgBackRestTest::Common::VmTest; diff --git a/test/lib/pgBackRestTest/Common/CoverageTest.pm b/test/lib/pgBackRestTest/Common/CoverageTest.pm index a7f6102fd..91fa02335 100644 --- a/test/lib/pgBackRestTest/Common/CoverageTest.pm +++ b/test/lib/pgBackRestTest/Common/CoverageTest.pm @@ -15,12 +15,11 @@ use Exporter qw(import); our @EXPORT = qw(); use File::Basename qw(dirname); -use pgBackRest::Version; - use pgBackRestDoc::Common::Log; use pgBackRestDoc::Common::String; use pgBackRestDoc::Html::DocHtmlBuilder; use pgBackRestDoc::Html::DocHtmlElement; +use pgBackRestDoc::ProjectInfo; #################################################################################################################################### # Generate an lcov configuration file diff --git a/test/lib/pgBackRestTest/Common/JobTest.pm b/test/lib/pgBackRestTest/Common/JobTest.pm index 912cd2167..bced8ae58 100644 --- a/test/lib/pgBackRestTest/Common/JobTest.pm +++ b/test/lib/pgBackRestTest/Common/JobTest.pm @@ -18,11 +18,10 @@ use File::Basename qw(dirname basename); use POSIX qw(ceil); use Time::HiRes qw(gettimeofday); -use pgBackRest::Version; - use pgBackRestDoc::Common::Exception; use pgBackRestDoc::Common::Log; use pgBackRestDoc::Common::String; +use pgBackRestDoc::ProjectInfo; use pgBackRestTest::Common::BuildTest; use pgBackRestTest::Common::ContainerTest; diff --git a/test/lib/pgBackRestTest/Common/LogTest.pm b/test/lib/pgBackRestTest/Common/LogTest.pm index bf7a11e4e..d5b9f8c74 100644 --- a/test/lib/pgBackRestTest/Common/LogTest.pm +++ b/test/lib/pgBackRestTest/Common/LogTest.pm @@ -15,9 +15,8 @@ use Exporter qw(import); our @EXPORT = qw(); use File::Basename qw(dirname); -use pgBackRest::Version; - use pgBackRestDoc::Common::Log; +use pgBackRestDoc::ProjectInfo; use pgBackRestTest::Common::ContainerTest; use pgBackRestTest::Common::ExecuteTest; diff --git a/test/lib/pgBackRestTest/Common/RunTest.pm b/test/lib/pgBackRestTest/Common/RunTest.pm index 4f4ab1dab..618473b19 100644 --- a/test/lib/pgBackRestTest/Common/RunTest.pm +++ b/test/lib/pgBackRestTest/Common/RunTest.pm @@ -15,11 +15,10 @@ use Exporter qw(import); our @EXPORT = qw(); use File::Basename qw(dirname); -use pgBackRest::Version; - use pgBackRestDoc::Common::Exception; use pgBackRestDoc::Common::Log; use pgBackRestDoc::Common::String; +use pgBackRestDoc::ProjectInfo; use pgBackRestTest::Common::BuildTest; use pgBackRestTest::Common::DefineTest; @@ -160,8 +159,6 @@ sub process $oStorage = new pgBackRestTest::Common::Storage( $self->testPath(), new pgBackRestTest::Common::StoragePosix({bFileSync => false, bPathSync => false})); - projectBinSet($self->{strBackRestExe}); - # Init, run, and end the test(s) $self->initModule(); $self->run(); diff --git a/test/lib/pgBackRestTest/Common/StorageRepo.pm b/test/lib/pgBackRestTest/Common/StorageRepo.pm index 040dd9cee..ac1e8cd60 100644 --- a/test/lib/pgBackRestTest/Common/StorageRepo.pm +++ b/test/lib/pgBackRestTest/Common/StorageRepo.pm @@ -17,10 +17,9 @@ use Fcntl qw(:mode); use File::stat qw{lstat}; use JSON::PP; -use pgBackRest::Version; - use pgBackRestDoc::Common::Exception; use pgBackRestDoc::Common::Log; +use pgBackRestDoc::ProjectInfo; use pgBackRestTest::Common::Io::Handle; use pgBackRestTest::Common::Io::Process; diff --git a/test/lib/pgBackRestTest/Env/ExpireEnvTest.pm b/test/lib/pgBackRestTest/Env/ExpireEnvTest.pm index fa9377e21..27fbaaad8 100644 --- a/test/lib/pgBackRestTest/Env/ExpireEnvTest.pm +++ b/test/lib/pgBackRestTest/Env/ExpireEnvTest.pm @@ -14,11 +14,10 @@ use Carp qw(confess); use Fcntl qw(O_RDONLY); use File::Basename qw(basename); -use pgBackRest::Version; - use pgBackRestDoc::Common::Exception; use pgBackRestDoc::Common::Ini; use pgBackRestDoc::Common::Log; +use pgBackRestDoc::ProjectInfo; use pgBackRestTest::Common::DbVersion; use pgBackRestTest::Common::ExecuteTest; diff --git a/test/lib/pgBackRestTest/Env/Host/HostBackupTest.pm b/test/lib/pgBackRestTest/Env/Host/HostBackupTest.pm index 823b6d567..8a2022032 100644 --- a/test/lib/pgBackRestTest/Env/Host/HostBackupTest.pm +++ b/test/lib/pgBackRestTest/Env/Host/HostBackupTest.pm @@ -18,12 +18,11 @@ use File::Basename qw(dirname); use File::stat qw{lstat}; use Storable qw(dclone); -use pgBackRest::Version; - use pgBackRestDoc::Common::Exception; use pgBackRestDoc::Common::Ini; use pgBackRestDoc::Common::Log; use pgBackRestDoc::Common::String; +use pgBackRestDoc::ProjectInfo; use pgBackRestTest::Common::DbVersion; use pgBackRestTest::Common::StorageBase; diff --git a/test/lib/pgBackRestTest/Env/Host/HostBaseTest.pm b/test/lib/pgBackRestTest/Env/Host/HostBaseTest.pm index 8e1f64c0f..e00db0b5c 100644 --- a/test/lib/pgBackRestTest/Env/Host/HostBaseTest.pm +++ b/test/lib/pgBackRestTest/Env/Host/HostBaseTest.pm @@ -16,9 +16,8 @@ use Exporter qw(import); our @EXPORT = qw(); use File::Basename qw(dirname); -use pgBackRest::Version; - use pgBackRestDoc::Common::Log; +use pgBackRestDoc::ProjectInfo; use pgBackRestTest::Common::ContainerTest; use pgBackRestTest::Common::ExecuteTest; diff --git a/test/lib/pgBackRestTest/Env/Host/HostDbCommonTest.pm b/test/lib/pgBackRestTest/Env/Host/HostDbCommonTest.pm index a623adaa1..f26ae52ac 100644 --- a/test/lib/pgBackRestTest/Env/Host/HostDbCommonTest.pm +++ b/test/lib/pgBackRestTest/Env/Host/HostDbCommonTest.pm @@ -16,12 +16,11 @@ use Exporter qw(import); use File::Basename qw(dirname); use Storable qw(dclone); -use pgBackRest::Version; - use pgBackRestDoc::Common::Exception; use pgBackRestDoc::Common::Ini; use pgBackRestDoc::Common::Log; use pgBackRestDoc::Common::String; +use pgBackRestDoc::ProjectInfo; use pgBackRestTest::Common::DbVersion; use pgBackRestTest::Common::ExecuteTest; diff --git a/test/lib/pgBackRestTest/Env/Host/HostDbSyntheticTest.pm b/test/lib/pgBackRestTest/Env/Host/HostDbSyntheticTest.pm index 7009ac197..fca6571a8 100644 --- a/test/lib/pgBackRestTest/Env/Host/HostDbSyntheticTest.pm +++ b/test/lib/pgBackRestTest/Env/Host/HostDbSyntheticTest.pm @@ -17,11 +17,10 @@ use Fcntl ':mode'; use File::Basename qw(basename dirname); use File::stat; -use pgBackRest::Version; - use pgBackRestDoc::Common::Exception; use pgBackRestDoc::Common::Log; use pgBackRestDoc::Common::String; +use pgBackRestDoc::ProjectInfo; use pgBackRestTest::Common::ContainerTest; use pgBackRestTest::Common::DbVersion; diff --git a/test/lib/pgBackRestTest/Env/Host/HostDbTest.pm b/test/lib/pgBackRestTest/Env/Host/HostDbTest.pm index 824c11099..6025ee5f6 100644 --- a/test/lib/pgBackRestTest/Env/Host/HostDbTest.pm +++ b/test/lib/pgBackRestTest/Env/Host/HostDbTest.pm @@ -16,11 +16,10 @@ use Exporter qw(import); our @EXPORT = qw(); use File::Basename qw(basename); -use pgBackRest::Version; - use pgBackRestDoc::Common::Exception; use pgBackRestDoc::Common::Log; use pgBackRestDoc::Common::String; +use pgBackRestDoc::ProjectInfo; use pgBackRestTest::Common::ContainerTest; use pgBackRestTest::Common::DbVersion; diff --git a/test/lib/pgBackRestTest/Env/Host/HostS3Test.pm b/test/lib/pgBackRestTest/Env/Host/HostS3Test.pm index abd31828b..5fc9b2269 100644 --- a/test/lib/pgBackRestTest/Env/Host/HostS3Test.pm +++ b/test/lib/pgBackRestTest/Env/Host/HostS3Test.pm @@ -17,11 +17,10 @@ use Exporter qw(import); use File::Basename qw(dirname); use Storable qw(dclone); -use pgBackRest::Version; - use pgBackRestDoc::Common::Exception; use pgBackRestDoc::Common::Ini; use pgBackRestDoc::Common::Log; +use pgBackRestDoc::ProjectInfo; use pgBackRestTest::Common::ContainerTest; use pgBackRestTest::Common::ExecuteTest; diff --git a/test/lib/pgBackRestTest/Module/Mock/MockAllTest.pm b/test/lib/pgBackRestTest/Module/Mock/MockAllTest.pm index 35d3bbad1..afc526398 100644 --- a/test/lib/pgBackRestTest/Module/Mock/MockAllTest.pm +++ b/test/lib/pgBackRestTest/Module/Mock/MockAllTest.pm @@ -13,12 +13,11 @@ use Carp qw(confess); use File::Basename qw(basename dirname); -use pgBackRest::Version; - use pgBackRestDoc::Common::Exception; use pgBackRestDoc::Common::Ini; use pgBackRestDoc::Common::Log; use pgBackRestDoc::Common::String; +use pgBackRestDoc::ProjectInfo; use pgBackRestTest::Common::ContainerTest; use pgBackRestTest::Common::DbVersion; diff --git a/test/lib/pgBackRestTest/Module/Real/RealAllTest.pm b/test/lib/pgBackRestTest/Module/Real/RealAllTest.pm index 1d96abe6c..4884059b5 100644 --- a/test/lib/pgBackRestTest/Module/Real/RealAllTest.pm +++ b/test/lib/pgBackRestTest/Module/Real/RealAllTest.pm @@ -13,11 +13,10 @@ use Carp qw(confess); use File::Basename qw(dirname); -use pgBackRest::Version; - use pgBackRestDoc::Common::Exception; use pgBackRestDoc::Common::Ini; use pgBackRestDoc::Common::Log; +use pgBackRestDoc::ProjectInfo; use pgBackRestTest::Common::ContainerTest; use pgBackRestTest::Common::DbVersion; diff --git a/test/test.pl b/test/test.pl index f9da016d4..f0634e179 100755 --- a/test/test.pl +++ b/test/test.pl @@ -27,11 +27,10 @@ use lib dirname(dirname($0)) . '/lib'; use lib dirname(dirname($0)) . '/build/lib'; use lib dirname(dirname($0)) . '/doc/lib'; -use pgBackRest::Version; - use pgBackRestDoc::Common::Exception; use pgBackRestDoc::Common::Log; use pgBackRestDoc::Common::String; +use pgBackRestDoc::ProjectInfo; use pgBackRestBuild::Build; use pgBackRestBuild::Build::Common; @@ -453,7 +452,7 @@ eval # Auto-generate version for configure.ac script #----------------------------------------------------------------------------------------------------------------------- - if (!$bSmart || grep(/^lib\/pgBackRest\/Version\.pm/, @stryModifiedList)) + if (!$bSmart || grep(/^src\/version\.h/, @stryModifiedList)) { my $strConfigureAcOld = ${$oStorageTest->get("${strBackRestBase}/src/configure.ac")}; my $strConfigureAcNew; @@ -623,27 +622,6 @@ eval { confess 'unable to find version ' . PROJECT_VERSION . " as the most recent release in ${strReleaseFile}"; } - - # Update version for the C code based on the current Perl version - #----------------------------------------------------------------------------------------------------------------------- - my $strCVersionFile = "${strBackRestBase}/src/version.h"; - my $strCVersionOld = ${$oStorageTest->get($strCVersionFile)}; - my $strCVersionNew; - - foreach my $strLine (split("\n", $strCVersionOld)) - { - if ($strLine =~ /^#define PROJECT_VERSION/) - { - $strLine = '#define PROJECT_VERSION' . (' ' x 45) . '"' . PROJECT_VERSION . '"'; - } - - $strCVersionNew .= "${strLine}\n"; - } - - if ($strCVersionNew ne $strCVersionOld) - { - $oStorageTest->put($strCVersionFile, $strCVersionNew); - } } # Clean up @@ -851,7 +829,7 @@ eval { my $strPackagePath = "${strVagrantPath}/package"; my $strPackageSmart = "${strPackagePath}/build.timestamp"; - my @stryPackageSrcPath = ('lib'); + my @stryPackageSrcPath = ('src'); # Find the lastest modified time for additional dirs that affect the package build foreach my $strPackageSrcPath (@stryPackageSrcPath)