summaryrefslogtreecommitdiffstats
path: root/Source/CPack
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2006-09-21 19:09:34 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2006-09-21 19:09:34 (GMT)
commit0952a96485cad05f68724f0a703758dceb60add9 (patch)
tree413039f1d18790ec8c876b96d045b92d29ce47fe /Source/CPack
parentd5d8687d16bf9b780c2de57a2f3f9d5a2cfe1545 (diff)
downloadCMake-0952a96485cad05f68724f0a703758dceb60add9.zip
CMake-0952a96485cad05f68724f0a703758dceb60add9.tar.gz
CMake-0952a96485cad05f68724f0a703758dceb60add9.tar.bz2
ENH: Handle zip (command line was too long)
Diffstat (limited to 'Source/CPack')
-rw-r--r--Source/CPack/cmCPackZIPGenerator.cxx23
1 files changed, 16 insertions, 7 deletions
diff --git a/Source/CPack/cmCPackZIPGenerator.cxx b/Source/CPack/cmCPackZIPGenerator.cxx
index 578fa0a..eeedaee 100644
--- a/Source/CPack/cmCPackZIPGenerator.cxx
+++ b/Source/CPack/cmCPackZIPGenerator.cxx
@@ -91,20 +91,22 @@ int cmCPackZIPGenerator::CompressFiles(const char* outFileName,
const char* toplevel, const std::vector<std::string>& files)
{
std::string tempFileName;
+ tempFileName = toplevel;
+ tempFileName += "/winZip.filelist";
+ bool needQuotesInFile = false;
cmOStringStream dmgCmd;
switch ( this->ZipStyle )
{
case cmCPackZIPGenerator::StyleWinZip:
- tempFileName = toplevel;
- tempFileName += "/winZip.filelist";
dmgCmd << "\"" << this->GetOption("CPACK_INSTALLER_PROGRAM")
<< "\" -P \"" << outFileName
<< "\" @\"" << tempFileName.c_str() << "\"";
+ needQuotesInFile = true;
break;
case cmCPackZIPGenerator::StyleUnixZip:
dmgCmd << "\"" << this->GetOption("CPACK_INSTALLER_PROGRAM")
- << "\" \"" << outFileName
- << "\"";
+ << "\" -r \"" << outFileName
+ << "\" . -i@winZip.filelist";
break;
default:
cmCPackLogger(cmCPackLog::LOG_ERROR, "Unknown ZIP style"
@@ -117,9 +119,16 @@ int cmCPackZIPGenerator::CompressFiles(const char* outFileName,
std::vector<std::string>::const_iterator fileIt;
for ( fileIt = files.begin(); fileIt != files.end(); ++ fileIt )
{
- out << "\""
- << cmSystemTools::RelativePath(toplevel, fileIt->c_str())
- << "\"" << std::endl;
+ if ( needQuotesInFile )
+ {
+ out << "\"";
+ }
+ out << cmSystemTools::RelativePath(toplevel, fileIt->c_str());
+ if ( needQuotesInFile )
+ {
+ out << "\"";
+ }
+ out << std::endl;
}
}
else