diff options
author | Brad King <brad.king@kitware.com> | 2019-09-05 12:24:38 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-09-05 12:24:50 (GMT) |
commit | fcba9c3baa00631407f493f97afe7e9cd1b844a7 (patch) | |
tree | 86ace1d0378fa1c649181a1ba9cbde3c11f1f654 /Source/CPack/cmCPackFreeBSDGenerator.cxx | |
parent | f545428be08531d2561feba4854793775be83c39 (diff) | |
parent | e26f0e9dd58b839b880670d6000e7f1ebac1df94 (diff) | |
download | CMake-fcba9c3baa00631407f493f97afe7e9cd1b844a7.zip CMake-fcba9c3baa00631407f493f97afe7e9cd1b844a7.tar.gz CMake-fcba9c3baa00631407f493f97afe7e9cd1b844a7.tar.bz2 |
Merge topic 'cpack-zstd'
e26f0e9dd5 CPack: Add generator for .tar.zst packages
f7085d7b0a cmCPackArchiveGenerator: Code cleanup
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3752
Diffstat (limited to 'Source/CPack/cmCPackFreeBSDGenerator.cxx')
-rw-r--r-- | Source/CPack/cmCPackFreeBSDGenerator.cxx | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/Source/CPack/cmCPackFreeBSDGenerator.cxx b/Source/CPack/cmCPackFreeBSDGenerator.cxx index bbba8a1..3979000 100644 --- a/Source/CPack/cmCPackFreeBSDGenerator.cxx +++ b/Source/CPack/cmCPackFreeBSDGenerator.cxx @@ -21,7 +21,7 @@ #include <utility> cmCPackFreeBSDGenerator::cmCPackFreeBSDGenerator() - : cmCPackArchiveGenerator(cmArchiveWrite::CompressXZ, "paxr") + : cmCPackArchiveGenerator(cmArchiveWrite::CompressXZ, "paxr", ".txz") { } @@ -276,12 +276,6 @@ void write_manifest_files(cmGeneratedFileStream& s, s << " },\n"; } -static bool has_suffix(const std::string& str, const std::string& suffix) -{ - return str.size() >= suffix.size() && - str.compare(str.size() - suffix.size(), suffix.size(), suffix) == 0; -} - int cmCPackFreeBSDGenerator::PackageFiles() { if (!this->ReadListFile("Internal/CPack/CPackFreeBSD.cmake")) { @@ -327,13 +321,13 @@ int cmCPackFreeBSDGenerator::PackageFiles() pkg_create_from_manifest(output_dir.c_str(), ::TXZ, toplevel.c_str(), manifestname.c_str(), nullptr); - std::string broken_suffix = std::string("-") + - var_lookup("CPACK_TOPLEVEL_TAG") + std::string(GetOutputExtension()); + std::string broken_suffix = + cmStrCat('-', var_lookup("CPACK_TOPLEVEL_TAG"), ".txz"); for (std::string& name : packageFileNames) { cmCPackLogger(cmCPackLog::LOG_DEBUG, "Packagefile " << name << std::endl); - if (has_suffix(name, broken_suffix)) { + if (cmHasSuffix(name, broken_suffix)) { name.replace(name.size() - broken_suffix.size(), std::string::npos, - GetOutputExtension()); + ".txz"); break; } } |