1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-10-30 23:37:45 +02:00

Rename cfgExe() to cfgBin().

This aligns better with naming in an upcoming commit.
This commit is contained in:
David Steele
2025-05-07 09:35:54 -04:00
parent d45da0363e
commit 32b69e9acc
10 changed files with 16 additions and 16 deletions

View File

@@ -748,7 +748,7 @@ cmdArchiveGet(void)
// Generate command options
StringList *const commandExec = cfgExecParam(cfgCmdArchiveGet, cfgCmdRoleAsync, optionReplace, true, false);
strLstInsert(commandExec, 0, cfgExe());
strLstInsert(commandExec, 0, cfgBin());
// Clean the current queue using the list of WAL that we ideally want in the queue. queueNeed() will return the
// list of WAL needed to fill the queue and this will be passed to the async process.

View File

@@ -362,7 +362,7 @@ cmdArchivePush(void)
// Generate command options
StringList *const commandExec = cfgExecParam(cfgCmdArchivePush, cfgCmdRoleAsync, optionReplace, true, false);
strLstInsert(commandExec, 0, cfgExe());
strLstInsert(commandExec, 0, cfgBin());
strLstAdd(commandExec, strPath(walFile));
// Clear errors for the current archive file

View File

@@ -155,11 +155,11 @@ cfgCommandParam(void)
/**********************************************************************************************************************************/
FN_EXTERN const String *
cfgExe(void)
cfgBin(void)
{
FUNCTION_TEST_VOID();
ASSERT(cfgInited());
FUNCTION_TEST_RETURN(STRING, configLocal->exe);
FUNCTION_TEST_RETURN(STRING, configLocal->bin);
}
/**********************************************************************************************************************************/

View File

@@ -252,8 +252,8 @@ FN_EXTERN bool cfgCommandHelp(void);
FN_EXTERN void cfgCommandSet(ConfigCommand commandId, ConfigCommandRole commandRoleId);
// pgBackRest exe
FN_EXTERN const String *cfgExe(void);
// Path to current pgbackrest binary
FN_EXTERN const String *cfgBin(void);
// Set option default. Option defaults are generally not set in advance because the vast majority of them are never used. It is more
// efficient to generate them when they are requested. Some defaults are (e.g. the exe path) are set at runtime.

View File

@@ -69,7 +69,7 @@ typedef struct Config
ConfigCommand command; // Current command
ConfigCommandRole commandRole; // Current command role
String *exe; // Location of the executable
String *bin; // Path to current pgbackrest binary
bool help; // Was help requested for the command?
bool lockRequired; // Is an immediate lock required?
bool lockRemoteRequired; // Is a lock required on the remote?

View File

@@ -121,15 +121,15 @@ cfgLoadUpdateOption(void)
// Set default for cmd
if (cfgOptionValid(cfgOptCmd))
cfgOptionDefaultSet(cfgOptCmd, VARSTR(cfgExe()));
cfgOptionDefaultSet(cfgOptCmd, VARSTR(cfgBin()));
// Set default for repo-host-cmd
if (cfgOptionValid(cfgOptRepoHostCmd))
cfgOptionDefaultSet(cfgOptRepoHostCmd, VARSTR(cfgExe()));
cfgOptionDefaultSet(cfgOptRepoHostCmd, VARSTR(cfgBin()));
// Set default for pg-host-cmd
if (cfgOptionValid(cfgOptPgHostCmd))
cfgOptionDefaultSet(cfgOptPgHostCmd, VARSTR(cfgExe()));
cfgOptionDefaultSet(cfgOptPgHostCmd, VARSTR(cfgBin()));
// Protocol timeout should be greater than db timeout
if (cfgOptionTest(cfgOptDbTimeout) && cfgOptionTest(cfgOptProtocolTimeout) &&

View File

@@ -1622,7 +1622,7 @@ cfgParse(const Storage *const storage, const unsigned int argListSize, const cha
{
.memContext = MEM_CONTEXT_NEW(),
.command = cfgCmdHelp,
.exe = strNewZ(argList[0]),
.bin = strNewZ(argList[0]),
};
}
OBJ_NEW_END();

View File

@@ -218,7 +218,7 @@ protocolLocalExec(
MEM_CONTEXT_PRIOR_BEGIN()
{
helper->exec = execNew(cfgExe(), param, name, cfgOptionUInt64(cfgOptProtocolTimeout));
helper->exec = execNew(cfgBin(), param, name, cfgOptionUInt64(cfgOptProtocolTimeout));
}
MEM_CONTEXT_PRIOR_END();
@@ -409,7 +409,7 @@ protocolServer(IoServer *const tlsServer, IoSession *const socketSession)
// Load parameter list from the client
StringList *const paramList = pckReadStrLstP(pckReadNew(command.param));
strLstInsert(paramList, 0, cfgExe());
strLstInsert(paramList, 0, cfgBin());
cfgLoad(strLstSize(paramList), strLstPtr(paramList));
// Error if the client is not authorized for the requested stanza

View File

@@ -157,7 +157,7 @@ testRun(void)
pid_t pid = getpid();
// Add parameters to arg list required for a reload
strLstInsert(argList, 0, cfgExe());
strLstInsert(argList, 0, cfgBin());
strLstAddZ(argList, CFGCMD_SERVER);
TEST_RESULT_VOID(cmdServer(strLstSize(argList), strLstPtr(argList)), "server");

View File

@@ -1767,7 +1767,7 @@ testRun(void)
TEST_RESULT_STR_Z(cfgCommandRoleName(), "backup", "command/role name is backup");
TEST_RESULT_STR_Z(cfgParseCommandRoleStr(cfgCmdRoleMain), NULL, "main role name is NULL");
TEST_RESULT_STR_Z(cfgExe(), TEST_BACKREST_EXE, "exe is set");
TEST_RESULT_STR_Z(cfgBin(), TEST_BACKREST_EXE, "bin is set");
TEST_RESULT_BOOL(cfgOptionTest(cfgOptConfig), false, "config is not set");
TEST_RESULT_INT(cfgOptionSource(cfgOptConfig), cfgSourceParam, "config is source param");
@@ -2051,7 +2051,7 @@ testRun(void)
TEST_RESULT_VOID(
cfgParseP(storageTest, strLstSize(argList), strLstPtr(argList), .noResetLogLevel = true), "load local config");
TEST_RESULT_STR_Z(cfgExe(), "pgbackrest", "--cmd not provided; cfgExe() returns " TEST_BACKREST_EXE);
TEST_RESULT_STR_Z(cfgBin(), "pgbackrest", "--cmd not provided; cfgBin() returns " TEST_BACKREST_EXE);
argList = strLstNew();
hrnCfgArgRawZ(argList, cfgOptStanza, "db");