Commit 88720153 authored by Brad King's avatar Brad King Committed by Kitware Robot

Merge topic 'fix-cpack-hdiutil-retry-loops'

05a76d53 CPack: Fix retry logic when calls to hdiutil fail
parents b9642401 05a76d53
......@@ -170,23 +170,25 @@ int cmCPackOSXX11Generator::PackageFiles()
<< "\" create -ov -format UDZO -srcfolder \""
<< diskImageDirectory.c_str()
<< "\" \"" << packageFileNames[0] << "\"";
int retVal = 1;
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
"Compress disk image using command: "
<< dmgCmd.str().c_str() << std::endl);
// since we get random dashboard failures with this one
// try running it more than once
int numTries = 4;
int retVal = 1;
int numTries = 10;
bool res = false;
while(numTries > 0)
{
res = cmSystemTools::RunSingleCommand(dmgCmd.str().c_str(), &output,
&retVal, 0,
this->GeneratorVerbose, 0);
if(res && retVal)
if ( res && !retVal )
{
numTries = -1;
break;
}
cmSystemTools::Delay(500);
numTries--;
}
if ( !res || retVal )
......
......@@ -319,17 +319,19 @@ int cmCPackPackageMakerGenerator::PackageFiles()
<< "\" \"" << packageFileNames[0] << "\"";
std::string output;
int retVal = 1;
int numTries = 4;
int numTries = 10;
bool res = false;
while(numTries > 0)
{
res = cmSystemTools::RunSingleCommand(dmgCmd.str().c_str(), &output,
&retVal, 0, this->GeneratorVerbose,
0);
if(res && retVal)
if ( res && !retVal )
{
numTries = -1;
break;
}
cmSystemTools::Delay(500);
numTries--;
}
if ( !res || retVal )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment