From 7e5222165d598b93e3166e9941a67f099fdfecdd Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Thu, 11 Sep 2008 10:48:49 -0400 Subject: [PATCH] ENH: add installed size to deb package --- Source/CPack/cmCPackDebGenerator.cxx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx index 6c0b46a5e..d2c691d8a 100644 --- a/Source/CPack/cmCPackDebGenerator.cxx +++ b/Source/CPack/cmCPackDebGenerator.cxx @@ -116,6 +116,17 @@ int cmCPackDebGenerator::CompressFiles(const char* outFileName, { out << "Suggests: " << debian_pkg_sug << "\n"; } + unsigned long totalSize = 0; + { + std::string dirName = this->GetOption("CPACK_TEMPORARY_DIRECTORY"); + dirName += '/'; + for (std::vector::const_iterator fileIt = files.begin(); + fileIt != files.end(); ++ fileIt ) + { + totalSize += cmSystemTools::FileLength(fileIt->c_str()); + } + } + out << "Installed-Size: " << totalSize << "\n"; out << "Maintainer: " << maintainer << "\n"; out << "Description: " << desc << "\n"; out << std::endl;