1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-07-03 00:26:59 +02:00

Minor refactor of version variable to a constant.

It had originally been designed to play nice with a specific packaging tool but that tool was never used.
This commit is contained in:
David Steele
2016-06-26 20:53:45 -04:00
parent 6ee485cc76
commit b571218930
7 changed files with 12 additions and 19 deletions

View File

@ -103,11 +103,10 @@ GetOptions ('help' => \$bHelp,
#################################################################################################################################### ####################################################################################################################################
eval eval
{ {
# Display version and exit if requested # Display version and exit if requested
if ($bHelp || $bVersion) if ($bHelp || $bVersion)
{ {
print BACKREST_NAME . ' ' . $VERSION . " Documentation Builder\n"; print BACKREST_NAME . ' ' . BACKREST_VERSION . " Documentation Builder\n";
if ($bHelp) if ($bHelp)
{ {

View File

@ -4,7 +4,7 @@
<!-- System-wide variables --> <!-- System-wide variables -->
<variable-list> <variable-list>
<variable key="project">pgBackRest</variable> <variable key="project">pgBackRest</variable>
<variable key="version" eval="y">use pgBackRest::Version; $VERSION</variable> <variable key="version" eval="y">use pgBackRest::Version; BACKREST_VERSION</variable>
<variable key="version-stable" eval="y"> <variable key="version-stable" eval="y">
use BackRestDoc::Custom::DocCustomRelease; use BackRestDoc::Custom::DocCustomRelease;

View File

@ -143,6 +143,10 @@
<release-item> <release-item>
<p>Option handling is now far more strict. Previously it was possible for a command to use an option that was not explicitly assigned to it. This was especially true for the <br-option>backup-host</br-option> and <br-option>db-host</br-option> options which are used to determine locality.</p> <p>Option handling is now far more strict. Previously it was possible for a command to use an option that was not explicitly assigned to it. This was especially true for the <br-option>backup-host</br-option> and <br-option>db-host</br-option> options which are used to determine locality.</p>
</release-item> </release-item>
<release-item>
<p>Minor refactor of version variable to a constant. It had originally been designed to play nice with a specific packaging tool but that tool was never used.</p>
</release-item>
</release-refactor-list> </release-refactor-list>
</release-core-list> </release-core-list>

View File

@ -30,14 +30,6 @@ use constant OP_INI => 'Ini';
use constant OP_INI_INI_SAVE => OP_INI . "::iniSave"; use constant OP_INI_INI_SAVE => OP_INI . "::iniSave";
use constant OP_INI_SET => OP_INI . "->set"; use constant OP_INI_SET => OP_INI . "->set";
####################################################################################################################################
# Version and Format Constants
####################################################################################################################################
use constant BACKREST_VERSION => "$VERSION";
push @EXPORT, qw(BACKREST_VERSION);
use constant BACKREST_FORMAT => "$FORMAT";
push @EXPORT, qw(BACKREST_FORMAT);
#################################################################################################################################### ####################################################################################################################################
# Boolean constants # Boolean constants
#################################################################################################################################### ####################################################################################################################################

View File

@ -27,18 +27,15 @@ use constant BACKREST_CONF => BACKREST_
# Defines the current version of the BackRest executable. The version number is used to track features but does not affect what # 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. # repositories or manifests can be read - that's the job of the format number.
#----------------------------------------------------------------------------------------------------------------------------------- #-----------------------------------------------------------------------------------------------------------------------------------
our # 'our' keyword is on a separate line to make the ExtUtils::MakeMaker parser happy. use constant BACKREST_VERSION => '1.03dev';
$VERSION = '1.03dev'; push @EXPORT, qw(BACKREST_VERSION);
push @EXPORT, qw($VERSION);
# Format Format Number # Format Format Number
# #
# Defines format for info and manifest files as well as on-disk structure. If this number changes then the repository will be # 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. # invalid unless migration functions are written.
#----------------------------------------------------------------------------------------------------------------------------------- #-----------------------------------------------------------------------------------------------------------------------------------
our $FORMAT = 5; use constant BACKREST_FORMAT => 5;
push @EXPORT, qw(BACKREST_FORMAT);
push @EXPORT, qw($FORMAT);
1; 1;

View File

@ -19,6 +19,7 @@ use pgBackRest::Db;
use pgBackRest::File; use pgBackRest::File;
use pgBackRest::FileCommon; use pgBackRest::FileCommon;
use pgBackRest::Manifest; use pgBackRest::Manifest;
use pgBackRest::Version;
use pgBackRestTest::Backup::Common::HostBackupTest; use pgBackRestTest::Backup::Common::HostBackupTest;
use pgBackRestTest::Common::ExecuteTest; use pgBackRestTest::Common::ExecuteTest;

View File

@ -137,7 +137,7 @@ GetOptions ('q|quiet' => \$bQuiet,
# Display version and exit if requested # Display version and exit if requested
if ($bVersion || $bHelp) if ($bVersion || $bHelp)
{ {
syswrite(*STDOUT, BACKREST_NAME . ' ' . $VERSION . " Test Engine\n"); syswrite(*STDOUT, BACKREST_NAME . ' ' . BACKREST_VERSION . " Test Engine\n");
if ($bHelp) if ($bHelp)
{ {