1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-06-14 23:44:58 +02:00

Add cmd-extra field.

Allow hidden options to be added to a command. This allows certain commands (like apt-get) to be forced during the build without making that a part of the documentation.
This commit is contained in:
David Steele
2016-06-03 20:07:28 -04:00
parent 36cf0b18f5
commit e796f563c4
4 changed files with 26 additions and 12 deletions

View File

@ -115,6 +115,11 @@ sub executeKey
output => JSON::PP::false,
};
if (defined($oCommand->fieldGet('exe-cmd-extra', false)))
{
$$hCacheKey{'cmd-extra'} = $oCommand->fieldGet('exe-cmd-extra');
}
if (defined($oCommand->paramGet('err-expect', false)))
{
$$hCacheKey{'err-expect'} = $oCommand->paramGet('err-expect');
@ -211,10 +216,11 @@ sub execute
confess &log(ERROR, "cannot execute on host ${strHostName} because the host does not exist");
}
my $oExec = $oHost->execute($strCommand,
{iExpectedExitStatus => $$hCacheKey{'err-expect'},
bSuppressError => $oCommand->paramTest('err-suppress', 'y'),
iRetrySeconds => $oCommand->paramGet('retry', false)});
my $oExec = $oHost->execute(
$strCommand . (defined($$hCacheKey{'cmd-extra'}) ? ' ' . $$hCacheKey{'cmd-extra'} : ''),
{iExpectedExitStatus => $$hCacheKey{'err-expect'},
bSuppressError => $oCommand->paramTest('err-suppress', 'y'),
iRetrySeconds => $oCommand->paramGet('retry', false)});
$oExec->begin();
$oExec->end();