ENH: fix crash in cygwin package stuff
This commit is contained in:
parent
3b7eaad890
commit
497779d4b3
|
@ -98,7 +98,15 @@ int cmCPackCygwinBinaryGenerator::CompressFiles(const char* outFileName,
|
||||||
const char* cmCPackCygwinBinaryGenerator::GetOutputExtension()
|
const char* cmCPackCygwinBinaryGenerator::GetOutputExtension()
|
||||||
{
|
{
|
||||||
this->OutputExtension = "-";
|
this->OutputExtension = "-";
|
||||||
this->OutputExtension += this->GetOption("CPACK_CYGWIN_PATCH_NUMBER");
|
const char* patchNumber =this->GetOption("CPACK_CYGWIN_PATCH_NUMBER");
|
||||||
|
if(!patchNumber)
|
||||||
|
{
|
||||||
|
patchNumber = "1";
|
||||||
|
cmCPackLogger(cmCPackLog::LOG_WARNING,
|
||||||
|
"CPACK_CYGWIN_PATCH_NUMBER not specified using 1"
|
||||||
|
<< std::endl);
|
||||||
|
}
|
||||||
|
this->OutputExtension +=
|
||||||
this->OutputExtension += ".tar.bz2";
|
this->OutputExtension += ".tar.bz2";
|
||||||
return this->OutputExtension.c_str();
|
return this->OutputExtension.c_str();
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,7 +59,9 @@ void cmCPackGenerator::DisplayVerboseOutput(const char* msg,
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
int cmCPackGenerator::PrepareNames()
|
int cmCPackGenerator::PrepareNames()
|
||||||
{
|
{
|
||||||
|
cmCPackLogger(cmCPackLog::LOG_DEBUG,
|
||||||
|
"Create temp directory." << std::endl);
|
||||||
|
|
||||||
std::string tempDirectory = this->GetOption("CPACK_PACKAGE_DIRECTORY");
|
std::string tempDirectory = this->GetOption("CPACK_PACKAGE_DIRECTORY");
|
||||||
tempDirectory += "/_CPack_Packages/";
|
tempDirectory += "/_CPack_Packages/";
|
||||||
|
@ -71,16 +73,34 @@ int cmCPackGenerator::PrepareNames()
|
||||||
}
|
}
|
||||||
tempDirectory += this->GetOption("CPACK_GENERATOR");
|
tempDirectory += this->GetOption("CPACK_GENERATOR");
|
||||||
std::string topDirectory = tempDirectory;
|
std::string topDirectory = tempDirectory;
|
||||||
|
this->GetOption("CPACK_PACKAGE_FILE_NAME");
|
||||||
std::string outName = this->GetOption("CPACK_PACKAGE_FILE_NAME");
|
const char* pfname = this->GetOption("CPACK_PACKAGE_FILE_NAME");
|
||||||
|
if(!pfname)
|
||||||
|
{
|
||||||
|
cmCPackLogger(cmCPackLog::LOG_ERROR,
|
||||||
|
"CPACK_PACKAGE_FILE_NAME not specified" << std::endl);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
std::string outName = pfname;
|
||||||
tempDirectory += "/" + outName;
|
tempDirectory += "/" + outName;
|
||||||
|
if(!this->GetOutputExtension())
|
||||||
|
{
|
||||||
|
cmCPackLogger(cmCPackLog::LOG_ERROR,
|
||||||
|
"No output extension specified" << std::endl);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
outName += this->GetOutputExtension();
|
outName += this->GetOutputExtension();
|
||||||
|
const char* pdir = this->GetOption("CPACK_PACKAGE_DIRECTORY");
|
||||||
|
if(!pdir)
|
||||||
|
{
|
||||||
|
cmCPackLogger(cmCPackLog::LOG_ERROR,
|
||||||
|
"CPACK_PACKAGE_DIRECTORY not specified" << std::endl);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
std::string destFile = this->GetOption("CPACK_PACKAGE_DIRECTORY");
|
std::string destFile = pdir;
|
||||||
destFile += "/" + outName;
|
destFile += "/" + outName;
|
||||||
|
|
||||||
std::string outFile = topDirectory + "/" + outName;
|
std::string outFile = topDirectory + "/" + outName;
|
||||||
|
|
||||||
bool setDestDir = cmSystemTools::IsOn(this->GetOption("CPACK_SET_DESTDIR"));
|
bool setDestDir = cmSystemTools::IsOn(this->GetOption("CPACK_SET_DESTDIR"));
|
||||||
std::string installPrefix = tempDirectory;
|
std::string installPrefix = tempDirectory;
|
||||||
if (!setDestDir)
|
if (!setDestDir)
|
||||||
|
@ -653,6 +673,7 @@ int cmCPackGenerator::DoPackage()
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( cmSystemTools::IsOn(
|
if ( cmSystemTools::IsOn(
|
||||||
this->GetOption("CPACK_REMOVE_TOPLEVEL_DIRECTORY")) )
|
this->GetOption("CPACK_REMOVE_TOPLEVEL_DIRECTORY")) )
|
||||||
{
|
{
|
||||||
|
@ -672,10 +693,16 @@ int cmCPackGenerator::DoPackage()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
cmCPackLogger(cmCPackLog::LOG_DEBUG,
|
||||||
|
"About to install project " << std::endl);
|
||||||
|
|
||||||
if ( !this->InstallProject() )
|
if ( !this->InstallProject() )
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
cmCPackLogger(cmCPackLog::LOG_DEBUG,
|
||||||
|
"Done install project " << std::endl);
|
||||||
|
|
||||||
|
|
||||||
const char* tempPackageFileName = this->GetOption(
|
const char* tempPackageFileName = this->GetOption(
|
||||||
"CPACK_TEMPORARY_PACKAGE_FILE_NAME");
|
"CPACK_TEMPORARY_PACKAGE_FILE_NAME");
|
||||||
|
@ -789,7 +816,7 @@ bool cmCPackGenerator::IsSet(const char* name) const
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
const char* cmCPackGenerator::GetOption(const char* op)
|
const char* cmCPackGenerator::GetOption(const char* op)
|
||||||
{
|
{
|
||||||
return this->MakefileMap->GetDefinition(op);
|
return this->MakefileMap->GetDefinition(op);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue