Commit 6e0cc37e authored by Bill Hoffman's avatar Bill Hoffman
Browse files

ENH: merge fix for cpack crash into main tree

parent 676ed21c
......@@ -99,10 +99,10 @@ int cmCPackGenericGenerator::PrepareNames()
"Look for: CPACK_PACKAGE_DESCRIPTION_FILE" << std::endl);
const char* descFileName
= this->GetOption("CPACK_PACKAGE_DESCRIPTION_FILE");
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"Look for: " << descFileName << std::endl);
if ( descFileName )
{
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"Look for: " << descFileName << std::endl);
if ( !cmSystemTools::FileExists(descFileName) )
{
cmCPackLogger(cmCPackLog::LOG_ERROR,
......@@ -158,7 +158,8 @@ int cmCPackGenericGenerator::InstallProject()
if ( !cmsys::SystemTools::MakeDirectory(tempInstallDirectory))
{
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Problem creating temporary directory: " << tempInstallDirectory
"Problem creating temporary directory: "
<< (tempInstallDirectory ? tempInstallDirectory : "(NULL}")
<< std::endl);
return 0;
}
......@@ -409,10 +410,10 @@ int cmCPackGenericGenerator::InstallProjectViaInstallScript(
= this->GetOption("CPACK_INSTALL_SCRIPT");
std::string currentWorkingDirectory =
cmSystemTools::GetCurrentWorkingDirectory();
cmCPackLogger(cmCPackLog::LOG_OUTPUT,
"- Install scripts: " << cmakeScripts << std::endl);
if ( cmakeScripts && *cmakeScripts )
{
cmCPackLogger(cmCPackLog::LOG_OUTPUT,
"- Install scripts: " << cmakeScripts << std::endl);
std::vector<std::string> cmakeScriptsVector;
cmSystemTools::ExpandListArgument(cmakeScripts,
cmakeScriptsVector);
......@@ -667,7 +668,7 @@ int cmCPackGenericGenerator::ProcessGenerator()
cmCPackLogger(cmCPackLog::LOG_OUTPUT, "Compress package" << std::endl);
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Compress files to: "
<< tempPackageFileName << std::endl);
<< (tempPackageFileName ? tempPackageFileName : "(NULL)") << std::endl);
if ( cmSystemTools::FileExists(tempPackageFileName) )
{
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Remove old package file"
......@@ -689,16 +690,23 @@ int cmCPackGenericGenerator::ProcessGenerator()
cmCPackLogger(cmCPackLog::LOG_OUTPUT, "Finalize package" << std::endl);
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Copy final package: "
<< tempPackageFileName << " to " << packageFileName << std::endl);
<< (tempPackageFileName ? tempPackageFileName : "(NULL)" )
<< " to "
<< (packageFileName ? packageFileName : "(NULL)")
<< std::endl);
if ( !cmSystemTools::CopyFileIfDifferent(tempPackageFileName,
packageFileName) )
{
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem copying the package: "
<< tempPackageFileName << " to " << packageFileName << std::endl);
<< (tempPackageFileName ? tempPackageFileName : "(NULL)" )
<< " to "
<< (packageFileName ? packageFileName : "(NULL)")
<< std::endl);
return 0;
}
cmCPackLogger(cmCPackLog::LOG_OUTPUT, "Package " << packageFileName
cmCPackLogger(cmCPackLog::LOG_OUTPUT, "Package "
<< (packageFileName ? packageFileName : "(NULL)")
<< " generated." << std::endl);
return 1;
}
......@@ -939,7 +947,7 @@ const char* cmCPackGenericGenerator::GetInstallPath()
std::string cmCPackGenericGenerator::FindTemplate(const char* name)
{
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Look for template: "
<< name << std::endl);
<< (name ? name : "(NULL)") << std::endl);
std::string ffile = this->MakefileMap->GetModulesFile(name);
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Found template: "
<< ffile.c_str() << std::endl);
......
......@@ -236,13 +236,16 @@ bool cmCPackPackageMakerGenerator::CopyCreateResourceFile(const char* name)
if ( !inFileName )
{
cmCPackLogger(cmCPackLog::LOG_ERROR, "CPack option: " << cpackVar.c_str()
<< " not specified. It should point to " << name << ".rtf, " << name
<< " not specified. It should point to "
<< (name ? name : "(NULL)")
<< ".rtf, " << name
<< ".html, or " << name << ".txt file" << std::endl);
return false;
}
if ( !cmSystemTools::FileExists(inFileName) )
{
cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find " << name
cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find "
<< (name ? name : "(NULL)")
<< " resource file: " << inFileName << std::endl);
return false;
}
......@@ -260,7 +263,8 @@ bool cmCPackPackageMakerGenerator::CopyCreateResourceFile(const char* name)
destFileName += name + ext;
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Configure file: " << inFileName
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Configure file: "
<< (inFileName ? inFileName : "(NULL)")
<< " to " << destFileName.c_str() << std::endl);
this->ConfigureFile(inFileName, destFileName.c_str());
return true;
......
......@@ -208,7 +208,8 @@ int cmCPackTGZGenerator::InitializeInternal()
int cmCPackTGZGenerator::CompressFiles(const char* outFileName,
const char* toplevel, const std::vector<std::string>& files)
{
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Toplevel: " << toplevel << std::endl);
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Toplevel: "
<< (toplevel ? toplevel : "(NULL)") << std::endl);
cmCPackTGZ_Data mydata(this, this->Compress);
TAR *t;
char buf[TAR_MAXPATHLEN];
......
......@@ -108,7 +108,7 @@ int cmCPackTarBZip2Generator::CompressFiles(const char* outFileName,
{
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem renaming: \""
<< compressOutFile.c_str() << "\" to \""
<< outFileName << std::endl);
<< (outFileName ? outFileName : "(NULL)") << std::endl);
return 0;
}
}
......
......@@ -155,7 +155,8 @@ int cmCPackTarCompressGenerator::InitializeInternal()
int cmCPackTarCompressGenerator::CompressFiles(const char* outFileName,
const char* toplevel, const std::vector<std::string>& files)
{
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Toplevel: " << toplevel << std::endl);
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Toplevel: "
<< (toplevel ? toplevel : "(NULL)") << std::endl);
cmCPackTarCompress_Data mydata(this);
TAR *t;
char buf[TAR_MAXPATHLEN];
......
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