Commit 042f4c33 authored by Bill Hoffman's avatar Bill Hoffman

ENH: fix crash in cpack when CPACK_CYGWIN_PATCH_NUMBER not specified

parent 5ab6c0f0
......@@ -32,8 +32,9 @@ if(CPACK_GENERATOR MATCHES "NSIS")
SET(CPACK_NSIS_CONTACT @CPACK_PACKAGE_CONTACT@)
SET(CPACK_NSIS_MODIFY_PATH ON)
endif(CPACK_GENERATOR MATCHES "NSIS")
# include the cpack options
INCLUDE("@QT_DIALOG_CPACK_OPTIONS_FILE@")
# include the cpack options for qt dialog if they exisit
# they might not if qt was not enabled for the build
INCLUDE("@QT_DIALOG_CPACK_OPTIONS_FILE@" OPTIONAL)
if(CPACK_GENERATOR MATCHES "CygwinSource")
# when packaging source make sure the .build directory is not included
......
......@@ -106,7 +106,7 @@ const char* cmCPackCygwinBinaryGenerator::GetOutputExtension()
"CPACK_CYGWIN_PATCH_NUMBER not specified using 1"
<< std::endl);
}
this->OutputExtension +=
this->OutputExtension += patchNumber;
this->OutputExtension += ".tar.bz2";
return this->OutputExtension.c_str();
}
......@@ -124,7 +124,14 @@ int cmCPackCygwinSourceGenerator::CompressFiles(const char* outFileName,
std::string outerTarFile
= this->GetOption("CPACK_TEMPORARY_DIRECTORY");
outerTarFile += "-";
outerTarFile += this->GetOption("CPACK_CYGWIN_PATCH_NUMBER");
const char* patch = this->GetOption("CPACK_CYGWIN_PATCH_NUMBER");
if(!patch)
{
cmCPackLogger(cmCPackLog::LOG_WARNING, "CPACK_CYGWIN_PATCH_NUMBER"
<< " not specified, defaulting to 1\n");
patch = "1";
}
outerTarFile += patch;
outerTarFile += "-src.tar";
std::string buildScript = cmSystemTools::GetFilenameName(
this->GetOption("CPACK_CYGWIN_BUILD_SCRIPT"));
......@@ -176,7 +183,14 @@ const char* cmCPackCygwinSourceGenerator::GetPackagingInstallPrefix()
const char* cmCPackCygwinSourceGenerator::GetOutputExtension()
{
this->OutputExtension = "-";
this->OutputExtension += this->GetOption("CPACK_CYGWIN_PATCH_NUMBER");
const char* patch = this->GetOption("CPACK_CYGWIN_PATCH_NUMBER");
if(!patch)
{
cmCPackLogger(cmCPackLog::LOG_WARNING, "CPACK_CYGWIN_PATCH_NUMBER"
<< " not specified, defaulting to 1\n");
patch = "1";
}
this->OutputExtension += patch;
this->OutputExtension += "-src.tar.bz2";
return this->OutputExtension.c_str();
}
......
......@@ -817,7 +817,15 @@ bool cmCPackGenerator::IsSet(const char* name) const
//----------------------------------------------------------------------
const char* cmCPackGenerator::GetOption(const char* op)
{
return this->MakefileMap->GetDefinition(op);
const char* ret = this->MakefileMap->GetDefinition(op);
if(!ret)
{
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"Warning, GetOption return NULL for: "
<< op
<< std::endl);
}
return ret;
}
//----------------------------------------------------------------------
......
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