ENH: Handle zip (command line was too long)
This commit is contained in:
parent
d5d8687d16
commit
0952a96485
@ -91,20 +91,22 @@ int cmCPackZIPGenerator::CompressFiles(const char* outFileName,
|
|||||||
const char* toplevel, const std::vector<std::string>& files)
|
const char* toplevel, const std::vector<std::string>& files)
|
||||||
{
|
{
|
||||||
std::string tempFileName;
|
std::string tempFileName;
|
||||||
|
tempFileName = toplevel;
|
||||||
|
tempFileName += "/winZip.filelist";
|
||||||
|
bool needQuotesInFile = false;
|
||||||
cmOStringStream dmgCmd;
|
cmOStringStream dmgCmd;
|
||||||
switch ( this->ZipStyle )
|
switch ( this->ZipStyle )
|
||||||
{
|
{
|
||||||
case cmCPackZIPGenerator::StyleWinZip:
|
case cmCPackZIPGenerator::StyleWinZip:
|
||||||
tempFileName = toplevel;
|
|
||||||
tempFileName += "/winZip.filelist";
|
|
||||||
dmgCmd << "\"" << this->GetOption("CPACK_INSTALLER_PROGRAM")
|
dmgCmd << "\"" << this->GetOption("CPACK_INSTALLER_PROGRAM")
|
||||||
<< "\" -P \"" << outFileName
|
<< "\" -P \"" << outFileName
|
||||||
<< "\" @\"" << tempFileName.c_str() << "\"";
|
<< "\" @\"" << tempFileName.c_str() << "\"";
|
||||||
|
needQuotesInFile = true;
|
||||||
break;
|
break;
|
||||||
case cmCPackZIPGenerator::StyleUnixZip:
|
case cmCPackZIPGenerator::StyleUnixZip:
|
||||||
dmgCmd << "\"" << this->GetOption("CPACK_INSTALLER_PROGRAM")
|
dmgCmd << "\"" << this->GetOption("CPACK_INSTALLER_PROGRAM")
|
||||||
<< "\" \"" << outFileName
|
<< "\" -r \"" << outFileName
|
||||||
<< "\"";
|
<< "\" . -i@winZip.filelist";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
cmCPackLogger(cmCPackLog::LOG_ERROR, "Unknown ZIP style"
|
cmCPackLogger(cmCPackLog::LOG_ERROR, "Unknown ZIP style"
|
||||||
@ -117,9 +119,16 @@ int cmCPackZIPGenerator::CompressFiles(const char* outFileName,
|
|||||||
std::vector<std::string>::const_iterator fileIt;
|
std::vector<std::string>::const_iterator fileIt;
|
||||||
for ( fileIt = files.begin(); fileIt != files.end(); ++ fileIt )
|
for ( fileIt = files.begin(); fileIt != files.end(); ++ fileIt )
|
||||||
{
|
{
|
||||||
out << "\""
|
if ( needQuotesInFile )
|
||||||
<< cmSystemTools::RelativePath(toplevel, fileIt->c_str())
|
{
|
||||||
<< "\"" << std::endl;
|
out << "\"";
|
||||||
|
}
|
||||||
|
out << cmSystemTools::RelativePath(toplevel, fileIt->c_str());
|
||||||
|
if ( needQuotesInFile )
|
||||||
|
{
|
||||||
|
out << "\"";
|
||||||
|
}
|
||||||
|
out << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user