summaryrefslogtreecommitdiffstats
path: root/Source/CPack/cmCPackPackageMakerGenerator.cxx
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2012-03-09 16:39:01 (GMT)
committerDavid Cole <david.cole@kitware.com>2012-03-09 16:39:01 (GMT)
commit05a76d53c0ff99f698760080c2fbde7f1e47cf7a (patch)
treec14165a2006f5726cfce628d711e70743ce41b0f /Source/CPack/cmCPackPackageMakerGenerator.cxx
parentc7bdef5b48fe74f92d75f538e702257e7de1a998 (diff)
downloadCMake-05a76d53c0ff99f698760080c2fbde7f1e47cf7a.zip
CMake-05a76d53c0ff99f698760080c2fbde7f1e47cf7a.tar.gz
CMake-05a76d53c0ff99f698760080c2fbde7f1e47cf7a.tar.bz2
CPack: Fix retry logic when calls to hdiutil fail
The long-standing sporadic failures of CPack tests on the Mac dashboards are caused by an occasional problem running hdiutil. To compensate for this, a retry loop was added in the code in a previous commit: a9fa71a4 ... but the logic for breaking out of the retry loop was flawed, breaking out of the loop (and not retrying) when the hdiutil command returns an error instead of when it returns success. This commit fixes the flawed logic, bumps up the number of retries from 4 to 10, and adds a half-second delay in between retries. The delay is specifically added in case a virus checker or spotlight indexer is temporarily causing the hdiutil failure by hanging onto a newly created file longer than hdiutil expects it to. As with all sporadically occurring issues, we'll never know if this is really fixed all the way. But I'll be happy even if we can only get it to happen just a bit less often.
Diffstat (limited to 'Source/CPack/cmCPackPackageMakerGenerator.cxx')
-rw-r--r--Source/CPack/cmCPackPackageMakerGenerator.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/CPack/cmCPackPackageMakerGenerator.cxx b/Source/CPack/cmCPackPackageMakerGenerator.cxx
index 0c4b1a6..327c4a6 100644
--- a/Source/CPack/cmCPackPackageMakerGenerator.cxx
+++ b/Source/CPack/cmCPackPackageMakerGenerator.cxx
@@ -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 )