You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-07-15 01:04:37 +02:00
Remove extraneous double spaces in code and comments.
This commit is contained in:
@ -282,7 +282,7 @@ sub execute
|
||||
$iFilterFirst = $iFilterFirst < 0 ? 0 : $iFilterFirst;
|
||||
|
||||
# Don't repeat lines that have already been output
|
||||
$iFilterFirst = $iFilterFirst <= $iLastOutput ? $iLastOutput + 1 : $iFilterFirst;
|
||||
$iFilterFirst = $iFilterFirst <= $iLastOutput ? $iLastOutput + 1 : $iFilterFirst;
|
||||
|
||||
# Determine the last line to output
|
||||
my $iFilterLast = $iIndex + $iFilterContext;
|
||||
|
@ -472,7 +472,7 @@ sub logDebugBuild
|
||||
(defined($strValueHash) ? ', ' : '{') . "${strSubValue} => " . ${logDebugBuild($strValue->{$strSubValue})};
|
||||
}
|
||||
|
||||
$rResult = \(defined($strValueHash) ? $strValueHash . '}' : '{}');
|
||||
$rResult = \(defined($strValueHash) ? $strValueHash . '}' : '{}');
|
||||
}
|
||||
# Value is an array
|
||||
elsif (ref($strValue) eq 'ARRAY')
|
||||
@ -484,7 +484,7 @@ sub logDebugBuild
|
||||
$strValueArray .= (defined($strValueArray) ? ', ' : '(') . ${logDebugBuild($strSubValue)};
|
||||
}
|
||||
|
||||
$rResult = \(defined($strValueArray) ? $strValueArray . ')' : '()');
|
||||
$rResult = \(defined($strValueArray) ? $strValueArray . ')' : '()');
|
||||
}
|
||||
# Else some other type ??? For the moment this is forced to object to not make big log changes
|
||||
else
|
||||
|
@ -389,7 +389,7 @@ sub docGet
|
||||
|
||||
# Get the end commit of the last release
|
||||
my $strReleaseLastVersion = $oyRelease[$iReleaseIdx + 1]->paramGet('version');
|
||||
my $rhReleaseLastCommitEnd = $self->commitFindSubject(\@hyGitLog, "v${strReleaseLastVersion}\\: .+");
|
||||
my $rhReleaseLastCommitEnd = $self->commitFindSubject(\@hyGitLog, "v${strReleaseLastVersion}\\: .+");
|
||||
|
||||
if (!defined($rhReleaseLastCommitEnd))
|
||||
{
|
||||
|
@ -715,7 +715,7 @@ cmdArchiveGet(void)
|
||||
// If the WAL segment has not already been found then start the async process to get it. There's no point in
|
||||
// forking the async process off more than once so track that as well. Use an archive lock to prevent forking if
|
||||
// the async process was launched by another process.
|
||||
if (!forked && (!found || !queueFull) &&
|
||||
if (!forked && (!found || !queueFull) &&
|
||||
lockAcquire(
|
||||
cfgOptionStr(cfgOptLockPath), cfgOptionStr(cfgOptStanza), cfgOptionStr(cfgOptExecId), cfgLockType(), 0,
|
||||
false))
|
||||
|
@ -1936,11 +1936,11 @@ backupProcess(BackupData *backupData, Manifest *manifest, const String *lsnStart
|
||||
// If hardlinking is enabled then create a hardlink for files that have not changed since the last backup
|
||||
if (hardLink)
|
||||
{
|
||||
LOG_DETAIL_FMT("hardlink %s to %s", strZ(file.name), strZ(file.reference));
|
||||
LOG_DETAIL_FMT("hardlink %s to %s", strZ(file.name), strZ(file.reference));
|
||||
|
||||
const String *const linkName = storagePathP(
|
||||
storageRepo(), strNewFmt("%s/%s%s", strZ(backupPathExp), strZ(file.name), compressExt));
|
||||
const String *const linkDestination = storagePathP(
|
||||
const String *const linkDestination = storagePathP(
|
||||
storageRepo(),
|
||||
strNewFmt(STORAGE_REPO_BACKUP "/%s/%s%s", strZ(file.reference), strZ(file.name), compressExt));
|
||||
|
||||
|
@ -1431,7 +1431,7 @@ infoRender(void)
|
||||
if (cfgOptionStrId(cfgOptOutput) == CFGOPTVAL_OUTPUT_TEXT)
|
||||
{
|
||||
// Process any stanza directories
|
||||
if (!varLstEmpty(infoList))
|
||||
if (!varLstEmpty(infoList))
|
||||
{
|
||||
for (unsigned int stanzaIdx = 0; stanzaIdx < varLstSize(infoList); stanzaIdx++)
|
||||
{
|
||||
|
@ -178,7 +178,7 @@ List *restoreFile(
|
||||
}
|
||||
|
||||
// Create and open the repo file
|
||||
repoFileRead = storageNewReadP(
|
||||
repoFileRead = storageNewReadP(
|
||||
storageRepoIdx(repoIdx), repoFile,
|
||||
.compressible = repoFileCompressType == compressTypeNone && cipherPass == NULL, .offset = file->offset,
|
||||
.limit = repoFileLimit != 0 ? VARUINT64(repoFileLimit) : NULL);
|
||||
|
@ -694,7 +694,7 @@ restoreManifestOwnerReplace(const String *const owner, const String *const owner
|
||||
{ \
|
||||
const String *owner = strLstGet(type##List, ownerIdx); \
|
||||
\
|
||||
if (type##Name() == NULL || !strEq(type##Name(), owner)) \
|
||||
if (type##Name() == NULL || !strEq(type##Name(), owner)) \
|
||||
LOG_WARN_FMT("unknown " #type " '%s' in backup manifest mapped to current " #type, strZ(owner)); \
|
||||
} \
|
||||
} \
|
||||
@ -1254,7 +1254,7 @@ restoreCleanBuild(const Manifest *const manifest, const String *const rootReplac
|
||||
const String *pgPath = storagePathP(storagePg(), manifestPathPg(path->name));
|
||||
StorageInfo pathInfo = storageInfoP(storagePg(), pgPath, .ignoreMissing = true);
|
||||
|
||||
// Create the path if it is missing If it exists it should already have the correct ownership and mode.
|
||||
// Create the path if it is missing. If it exists it should already have the correct ownership and mode.
|
||||
if (!pathInfo.exists)
|
||||
{
|
||||
LOG_DETAIL_FMT("create path '%s'", strZ(pgPath));
|
||||
|
@ -101,7 +101,7 @@ cmdServerSigChild(const int signalType, siginfo_t *signalInfo, void *context)
|
||||
ASSERT(signalInfo->si_code == CLD_EXITED);
|
||||
|
||||
// Find the process and remove it
|
||||
for (unsigned int processIdx = 0; processIdx < lstSize(serverLocal.processList); processIdx++)
|
||||
for (unsigned int processIdx = 0; processIdx < lstSize(serverLocal.processList); processIdx++)
|
||||
{
|
||||
if (*(int *)lstGet(serverLocal.processList, processIdx) == signalInfo->si_pid)
|
||||
lstRemoveIdx(serverLocal.processList, processIdx);
|
||||
@ -200,7 +200,7 @@ cmdServer(const unsigned int argListSize, const char *argList[])
|
||||
{
|
||||
sigaction(SIGCHLD, &(struct sigaction){.sa_flags = SA_NOCLDSTOP | SA_NOCLDWAIT}, NULL);
|
||||
|
||||
for (unsigned int processIdx = 0; processIdx < lstSize(serverLocal.processList); processIdx++)
|
||||
for (unsigned int processIdx = 0; processIdx < lstSize(serverLocal.processList); processIdx++)
|
||||
{
|
||||
pid_t pid = *(int *)lstGet(serverLocal.processList, processIdx);
|
||||
|
||||
|
@ -35,7 +35,7 @@ Integer types (packTypeMapData[type].valueMultiBit) when an unsigned value is <=
|
||||
1 0 0 1 - the low-order bit is 1 so the "ID delta low order bit" is set.
|
||||
04 = since the low order bit of the internal ID delta was already set in bit 0 of the tag byte, then the remain bits are shifted
|
||||
right by one and represented in this second byte as 4. To get the ID delta for 04, shift the 4 back to the left one and then
|
||||
add back the "ID delta low order bit" to give a binary representation of 1 0 0 1 = 9. Add back the 1 which is never
|
||||
add back the "ID delta low order bit" to give a binary representation of 1 0 0 1 = 9. Add back the 1 which is never
|
||||
recorded and the ID gap is 10.
|
||||
|
||||
Integer types (packTypeMapData[type].valueMultiBit) when an unsigned value is > 1 or a signed value is < -1 or > 0:
|
||||
@ -81,7 +81,7 @@ Array and object types:
|
||||
0-2 - ID delta low order bits
|
||||
Note: arrays and objects are merely containers for the other pack types.
|
||||
|
||||
Example: 1801 (container begin)
|
||||
Example: 1801 (container begin)
|
||||
1 = array type
|
||||
8 = "more ID delta indicator bit" - there exists a gap (i.e. NULLs are not stored so there is a gap between the stored IDs)
|
||||
01 = since there are three "ID delta low order bits", the 01 will be shifted left by 3 with zeros, resulting in 8. Add back
|
||||
|
@ -5,7 +5,7 @@ Strings are lightweight objects in that they do not have their own memory contex
|
||||
which they are instantiated. If a string is needed outside the current memory context, the memory context must be switched to the
|
||||
old context and then back. Below is a simplified example:
|
||||
|
||||
String *result = NULL; <--- is created in the current memory context (referred to as "old context" below)
|
||||
String *result = NULL; <--- is created in the current memory context (referred to as "old context" below)
|
||||
MEM_CONTEXT_TEMP_BEGIN() <--- begins a new temporary context
|
||||
{
|
||||
String *resultStr = strNewZN("myNewStr"); <--- creates a string in the temporary memory context
|
||||
|
@ -24,7 +24,7 @@ strLstAddInternal(StringList *const this, String *const string)
|
||||
/***********************************************************************************************************************************
|
||||
Internal insert -- the string must have been created in the list's mem context before being passed
|
||||
***********************************************************************************************************************************/
|
||||
__attribute__((always_inline)) static inline String *
|
||||
__attribute__((always_inline)) static inline String *
|
||||
strLstInsertInternal(StringList *const this, const unsigned int listIdx, String *const string)
|
||||
{
|
||||
return *(String **)lstInsert((List *)this, listIdx, &string);
|
||||
@ -86,7 +86,7 @@ strLstNewVarLst(const VariantList *sourceList)
|
||||
// Create the list
|
||||
StringList *this = NULL;
|
||||
|
||||
if (sourceList != NULL)
|
||||
if (sourceList != NULL)
|
||||
{
|
||||
this = strLstNew();
|
||||
|
||||
|
@ -2163,7 +2163,7 @@ configParse(const Storage *storage, unsigned int argListSize, const char *argLis
|
||||
MEM_CONTEXT_END();
|
||||
|
||||
// If a numeric type check that the value is valid
|
||||
if (optionType == cfgOptTypeInteger || optionType == cfgOptTypeSize ||
|
||||
if (optionType == cfgOptTypeInteger || optionType == cfgOptTypeSize ||
|
||||
optionType == cfgOptTypeTime)
|
||||
{
|
||||
// Check that the value can be converted
|
||||
|
@ -813,7 +813,7 @@ protocolKeepAlive(void)
|
||||
|
||||
if (protocolHelper.memContext != NULL)
|
||||
{
|
||||
for (unsigned int clientIdx = 0; clientIdx < protocolHelper.clientRemoteSize; clientIdx++)
|
||||
for (unsigned int clientIdx = 0; clientIdx < protocolHelper.clientRemoteSize; clientIdx++)
|
||||
{
|
||||
if (protocolHelper.clientRemote[clientIdx].client != NULL)
|
||||
protocolClientNoOp(protocolHelper.clientRemote[clientIdx].client);
|
||||
|
@ -80,7 +80,7 @@ sub codeCountScan
|
||||
{
|
||||
$strClass = 'doc/core';
|
||||
}
|
||||
elsif ($strFile =~ '^build/' || $strFile eq 'src/Makefile.in' || $strFile eq 'src/configure' ||
|
||||
elsif ($strFile =~ '^build/' || $strFile eq 'src/Makefile.in' || $strFile eq 'src/configure' ||
|
||||
$strFile =~ '^src/build/')
|
||||
{
|
||||
$strClass = 'build';
|
||||
|
@ -282,7 +282,7 @@ sub caSetup
|
||||
$strScript .=
|
||||
" update-ca-trust extract";
|
||||
}
|
||||
elsif ($strOsBase eq VM_OS_BASE_DEBIAN)
|
||||
elsif ($strOsBase eq VM_OS_BASE_DEBIAN)
|
||||
{
|
||||
$strScript .=
|
||||
" update-ca-certificates";
|
||||
@ -468,7 +468,7 @@ sub containerBuild
|
||||
#---------------------------------------------------------------------------------------------------------------------------
|
||||
if (!$bDeprecated)
|
||||
{
|
||||
$strScript .= sectionHeader() .
|
||||
$strScript .= sectionHeader() .
|
||||
"# Install PostgreSQL packages\n";
|
||||
|
||||
if ($$oVm{$strOS}{&VM_OS_BASE} eq VM_OS_BASE_RHEL)
|
||||
@ -527,12 +527,12 @@ sub containerBuild
|
||||
my $strDbVersionNoDot = $strDbVersion;
|
||||
$strDbVersionNoDot =~ s/\.//;
|
||||
|
||||
$strScript .= " postgresql${strDbVersionNoDot}-server";
|
||||
$strScript .= " postgresql${strDbVersionNoDot}-server";
|
||||
|
||||
# Add development package for the latest version of postgres
|
||||
if ($strDbVersion eq @{$oOS->{&VM_DB}}[-1])
|
||||
{
|
||||
$strScript .= " postgresql${strDbVersionNoDot}-devel";
|
||||
$strScript .= " postgresql${strDbVersionNoDot}-devel";
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -553,7 +553,7 @@ sub containerBuild
|
||||
#---------------------------------------------------------------------------------------------------------------------------
|
||||
if ($$oVm{$strOS}{&VM_OS_BASE} eq VM_OS_BASE_DEBIAN)
|
||||
{
|
||||
$strScript .= sectionHeader() .
|
||||
$strScript .= sectionHeader() .
|
||||
"# Cleanup\n";
|
||||
|
||||
$strScript .=
|
||||
@ -624,7 +624,7 @@ sub containerBuild
|
||||
$strScript .=
|
||||
sshSetup($strOS, TEST_USER, TEST_GROUP, $$oVm{$strOS}{&VM_CONTROL_MTR});
|
||||
|
||||
$strScript .= sectionHeader() .
|
||||
$strScript .= sectionHeader() .
|
||||
"# Make " . TEST_USER . " home dir readable\n" .
|
||||
' chmod g+r,g+x /home/' . TEST_USER;
|
||||
|
||||
|
@ -8,7 +8,7 @@ use warnings FATAL => qw(all);
|
||||
use Carp qw(confess);
|
||||
|
||||
use Exporter qw(import);
|
||||
our @EXPORT = qw();
|
||||
our @EXPORT = qw();
|
||||
|
||||
use pgBackRestDoc::Common::Log;
|
||||
|
||||
|
@ -119,7 +119,7 @@ sub error
|
||||
|
||||
logErrorResult(
|
||||
$iErrorCode, $self->id() . ' terminated unexpectedly' .
|
||||
($self->{iExitStatus} != 255 ? sprintf(' [%03d]', $self->{iExitStatus}) : ''),
|
||||
($self->{iExitStatus} != 255 ? sprintf(' [%03d]', $self->{iExitStatus}) : ''),
|
||||
$strError);
|
||||
}
|
||||
}
|
||||
|
@ -810,7 +810,7 @@ sub end
|
||||
if ($iExitStatus == 0 && $self->{oTest}->{&TEST_C} && $self->{bProfile})
|
||||
{
|
||||
executeTest(
|
||||
($self->{oTest}->{&TEST_VM} ne VM_NONE ? 'docker exec -i -u ' . TEST_USER . " ${strImage} " : '') .
|
||||
($self->{oTest}->{&TEST_VM} ne VM_NONE ? 'docker exec -i -u ' . TEST_USER . " ${strImage} " : '') .
|
||||
"gprof $self->{strGCovPath}/test.bin $self->{strGCovPath}/gmon.out > $self->{strGCovPath}/gprof.txt");
|
||||
|
||||
$self->{oStorageTest}->pathCreate(
|
||||
|
@ -283,7 +283,7 @@ sub archiveIdList
|
||||
# Get the version and system-id for all known databases
|
||||
my $hDbList = $self->dbHistoryList();
|
||||
|
||||
foreach my $iDbHistoryId (sort {$a <=> $b} keys %$hDbList)
|
||||
foreach my $iDbHistoryId (sort {$a <=> $b} keys %$hDbList)
|
||||
{
|
||||
# If the version and system-id match then construct the archive id so that the constructed array has the newest match first
|
||||
if (($hDbList->{$iDbHistoryId}{&INFO_DB_VERSION} eq $strDbVersion) &&
|
||||
|
@ -809,7 +809,7 @@ sub dbSectionSet
|
||||
|
||||
# Fill db history
|
||||
$self->numericSet(INFO_BACKUP_SECTION_DB_HISTORY, $iDbHistoryId, INFO_BACKUP_KEY_CATALOG, $iCatalogVersion);
|
||||
$self->numericSet(INFO_BACKUP_SECTION_DB_HISTORY, $iDbHistoryId, INFO_BACKUP_KEY_CONTROL, $iControlVersion);
|
||||
$self->numericSet(INFO_BACKUP_SECTION_DB_HISTORY, $iDbHistoryId, INFO_BACKUP_KEY_CONTROL, $iControlVersion);
|
||||
$self->numericSet(INFO_BACKUP_SECTION_DB_HISTORY, $iDbHistoryId, INFO_BACKUP_KEY_SYSTEM_ID, $ullDbSysId);
|
||||
$self->set(INFO_BACKUP_SECTION_DB_HISTORY, $iDbHistoryId, INFO_BACKUP_KEY_DB_VERSION, $strDbVersion . '');
|
||||
|
||||
|
@ -180,7 +180,7 @@ sub new
|
||||
$self->{strLockPath} = $self->testPath() . '/' . HOST_PATH_LOCK;
|
||||
|
||||
# Set conf file
|
||||
$self->{strBackRestConfig} = $self->testPath() . '/' . PROJECT_CONF;
|
||||
$self->{strBackRestConfig} = $self->testPath() . '/' . PROJECT_CONF;
|
||||
|
||||
# Set LogTest object
|
||||
$self->{oLogTest} = $$oParam{oLogTest};
|
||||
|
@ -165,7 +165,7 @@ sub run
|
||||
|
||||
# Perform a successful stanza upgrade noting additional history lines in info files for new version of the database
|
||||
#--------------------------------------------------------------------------------------------------------------------------
|
||||
# Save a pre-upgrade copy of archive info for testing db-id mismatch
|
||||
# Save a pre-upgrade copy of archive info for testing db-id mismatch
|
||||
forceStorageMove(storageRepo(), $strArchiveInfoCopyFile, $strArchiveInfoCopyOldFile, {bRecurse => false});
|
||||
|
||||
$oHostBackup->stanzaUpgrade('successful upgrade creates additional history', {strOptionalParam => '--no-online'});
|
||||
@ -214,7 +214,7 @@ sub run
|
||||
forceStorageRemove(storageRepo(), $strArchiveInfoCopyFile, {bRecurse => false});
|
||||
forceStorageMove(storageRepo(), $strArchiveInfoCopyOldFile, $strArchiveInfoFile, {bRecurse => false});
|
||||
|
||||
# Confirm versions
|
||||
# Confirm versions
|
||||
my $oArchiveInfo = new pgBackRestTest::Env::ArchiveInfo($oHostBackup->repoArchivePath());
|
||||
my $oBackupInfo = new pgBackRestTest::Env::BackupInfo($oHostBackup->repoBackupPath());
|
||||
$self->testResult(sub {$oArchiveInfo->test(INFO_ARCHIVE_SECTION_DB, INFO_ARCHIVE_KEY_DB_VERSION, undef,
|
||||
|
@ -507,7 +507,7 @@ sub run
|
||||
$oHostDbPrimary->sqlWalRotate();
|
||||
|
||||
# Get the SHA1 and path of the table for the database that will not be restored
|
||||
$strDb1TablePath = $oHostDbPrimary->dbBasePath(). "/base/" .
|
||||
$strDb1TablePath = $oHostDbPrimary->dbBasePath(). "/base/" .
|
||||
$oHostDbPrimary->sqlSelectOne("select oid from pg_database where datname='test1'") . "/" .
|
||||
$oHostDbPrimary->sqlSelectOne("select relfilenode from pg_class where relname='test1_zeroed'", {strDb => 'test1'});
|
||||
$strDb1TableSha1 = storageTest()->hashSize($strDb1TablePath);
|
||||
|
@ -695,7 +695,7 @@ eval
|
||||
my $strCFlags =
|
||||
(vmWithBackTrace($strBuildVM) && $bBackTrace ? ' -DWITH_BACKTRACE' : '') .
|
||||
($bDebugTestTrace ? ' -DDEBUG_TEST_TRACE' : '');
|
||||
my $strLdFlags = vmWithBackTrace($strBuildVM) && $bBackTrace ? '-lbacktrace' : '';
|
||||
my $strLdFlags = vmWithBackTrace($strBuildVM) && $bBackTrace ? '-lbacktrace' : '';
|
||||
my $strConfigOptions = (vmDebugIntegration($strBuildVM) ? ' --enable-test' : '');
|
||||
my $strBuildFlags = "CFLAGS_EXTRA=${strCFlags}\nLDFLAGS_EXTRA=${strLdFlags}\nCONFIGURE=${strConfigOptions}";
|
||||
my $strBuildFlagFile = "${strBinPath}/${strBuildVM}/build.flags";
|
||||
|
Reference in New Issue
Block a user