|
|
@@ -32,8 +32,8 @@ class DebGenerator
|
|
|
public:
|
|
|
DebGenerator(cmCPackLog* logger, std::string outputName, std::string workDir,
|
|
|
std::string topLevelDir, std::string temporaryDir,
|
|
|
- cmValue debianCompressionType, cmValue numThreads,
|
|
|
- cmValue debianArchiveType,
|
|
|
+ cmValue debianCompressionType, cmValue debianCompressionLevel,
|
|
|
+ cmValue numThreads, cmValue debianArchiveType,
|
|
|
std::map<std::string, std::string> controlValues,
|
|
|
bool genShLibs, std::string shLibsFilename, bool genPostInst,
|
|
|
std::string postInst, bool genPostRm, std::string postRm,
|
|
|
@@ -69,16 +69,18 @@ private:
|
|
|
bool const PermissionStrictPolicy;
|
|
|
std::vector<std::string> const PackageFiles;
|
|
|
cmArchiveWrite::Compress TarCompressionType;
|
|
|
+ int CompressionLevel = 0;
|
|
|
};
|
|
|
|
|
|
DebGenerator::DebGenerator(
|
|
|
cmCPackLog* logger, std::string outputName, std::string workDir,
|
|
|
std::string topLevelDir, std::string temporaryDir,
|
|
|
- cmValue debCompressionType, cmValue numThreads, cmValue debianArchiveType,
|
|
|
- std::map<std::string, std::string> controlValues, bool genShLibs,
|
|
|
- std::string shLibsFilename, bool genPostInst, std::string postInst,
|
|
|
- bool genPostRm, std::string postRm, cmValue controlExtra,
|
|
|
- bool permissionStrictPolicy, std::vector<std::string> packageFiles)
|
|
|
+ cmValue debCompressionType, cmValue debCompressionLevel, cmValue numThreads,
|
|
|
+ cmValue debianArchiveType, std::map<std::string, std::string> controlValues,
|
|
|
+ bool genShLibs, std::string shLibsFilename, bool genPostInst,
|
|
|
+ std::string postInst, bool genPostRm, std::string postRm,
|
|
|
+ cmValue controlExtra, bool permissionStrictPolicy,
|
|
|
+ std::vector<std::string> packageFiles)
|
|
|
: Logger(logger)
|
|
|
, OutputName(std::move(outputName))
|
|
|
, WorkDir(std::move(workDir))
|
|
|
@@ -135,6 +137,19 @@ DebGenerator::DebGenerator(
|
|
|
} else {
|
|
|
this->NumThreads = 1;
|
|
|
}
|
|
|
+
|
|
|
+ if (debCompressionLevel) {
|
|
|
+ long compressionLevel;
|
|
|
+ if (!cmStrToLong(*debCompressionLevel, &compressionLevel)) {
|
|
|
+ compressionLevel = 0;
|
|
|
+ cmCPackLogger(cmCPackLog::LOG_ERROR,
|
|
|
+ "Unrecognized compression level: " << debCompressionLevel
|
|
|
+ << std::endl);
|
|
|
+ }
|
|
|
+ this->CompressionLevel = static_cast<int>(compressionLevel);
|
|
|
+ } else {
|
|
|
+ this->CompressionLevel = 0;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
bool DebGenerator::generate() const
|
|
|
@@ -192,7 +207,7 @@ bool DebGenerator::generateDataTar() const
|
|
|
return false;
|
|
|
}
|
|
|
cmArchiveWrite data_tar(fileStream_data_tar, this->TarCompressionType,
|
|
|
- this->DebianArchiveType, 0,
|
|
|
+ this->DebianArchiveType, this->CompressionLevel,
|
|
|
static_cast<int>(this->NumThreads));
|
|
|
if (!data_tar.Open()) {
|
|
|
cmCPackLogger(cmCPackLog::LOG_ERROR,
|
|
|
@@ -324,7 +339,7 @@ bool DebGenerator::generateControlTar(std::string const& md5Filename) const
|
|
|
return false;
|
|
|
}
|
|
|
cmArchiveWrite control_tar(fileStream_control_tar, this->TarCompressionType,
|
|
|
- this->DebianArchiveType);
|
|
|
+ this->DebianArchiveType, this->CompressionLevel);
|
|
|
if (!control_tar.Open()) {
|
|
|
cmCPackLogger(cmCPackLog::LOG_ERROR,
|
|
|
"Error opening the archive \""
|
|
|
@@ -846,6 +861,7 @@ bool cmCPackDebGenerator::createDeb()
|
|
|
this->GetOption("CPACK_TOPLEVEL_DIRECTORY"),
|
|
|
this->GetOption("CPACK_TEMPORARY_DIRECTORY"),
|
|
|
this->GetOption("GEN_CPACK_DEBIAN_COMPRESSION_TYPE"),
|
|
|
+ this->GetOption("GEN_CPACK_DEBIAN_COMPRESSION_LEVEL"),
|
|
|
this->GetOption("CPACK_THREADS"),
|
|
|
this->GetOption("GEN_CPACK_DEBIAN_ARCHIVE_TYPE"), controlValues, gen_shibs,
|
|
|
shlibsfilename, this->IsOn("GEN_CPACK_DEBIAN_GENERATE_POSTINST"), postinst,
|
|
|
@@ -901,6 +917,7 @@ bool cmCPackDebGenerator::createDbgsymDDeb()
|
|
|
this->GetOption("CPACK_TOPLEVEL_DIRECTORY"),
|
|
|
this->GetOption("CPACK_TEMPORARY_DIRECTORY"),
|
|
|
this->GetOption("GEN_CPACK_DEBIAN_COMPRESSION_TYPE"),
|
|
|
+ this->GetOption("GEN_CPACK_DEBIAN_COMPRESSION_LEVEL"),
|
|
|
this->GetOption("CPACK_THREADS"),
|
|
|
this->GetOption("GEN_CPACK_DEBIAN_ARCHIVE_TYPE"), controlValues, false, "",
|
|
|
false, "", false, "", nullptr,
|