From 4c108d2a240ed384dc675b3e7db99297056d790a Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Mon, 17 Dec 2007 15:27:30 -0500 Subject: ENH: try to fix dashboard --- Source/CPack/cmCPackPackageMakerGenerator.cxx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Source/CPack/cmCPackPackageMakerGenerator.cxx b/Source/CPack/cmCPackPackageMakerGenerator.cxx index 47078a7..1e9a3eb 100644 --- a/Source/CPack/cmCPackPackageMakerGenerator.cxx +++ b/Source/CPack/cmCPackPackageMakerGenerator.cxx @@ -112,7 +112,23 @@ int cmCPackPackageMakerGenerator::CompressFiles(const char* outFileName, << std::endl); return 0; } - + // sometimes the pkgCmd finishes but the directory is not yet + // created, so try 10 times to see if it shows up + int tries = 10; + while(tries > 0 && + !cmSystemTools::FileExists(packageDirFileName.c_str())) + { + cmSystemTools::Delay(500); + tries--; + } + if(!cmSystemTools::FileExists(packageDirFileName.c_str())) + { + cmCPackLogger( + cmCPackLog::LOG_ERROR, + "Problem running PackageMaker command: " << pkgCmd.str().c_str() + << std::endl << "Package not created: " << packageDirFileName.c_str() + << std::endl); + } tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); tmpFile += "/hdiutilOutput.log"; cmOStringStream dmgCmd; -- cgit v0.12