From e26f0e9dd58b839b880670d6000e7f1ebac1df94 Mon Sep 17 00:00:00 2001 From: Regina Pfeifer Date: Wed, 28 Aug 2019 22:05:45 +0200 Subject: CPack: Add generator for .tar.zst packages --- Help/cpack_gen/archive.rst | 1 + Help/release/dev/cpack-zstd.rst | 5 +++++ Source/CPack/cmCPackArchiveGenerator.cxx | 6 ++++++ Source/CPack/cmCPackArchiveGenerator.h | 1 + Source/CPack/cmCPackGeneratorFactory.cxx | 2 ++ 5 files changed, 15 insertions(+) create mode 100644 Help/release/dev/cpack-zstd.rst diff --git a/Help/cpack_gen/archive.rst b/Help/cpack_gen/archive.rst index b288aad..d455f4b 100644 --- a/Help/cpack_gen/archive.rst +++ b/Help/cpack_gen/archive.rst @@ -9,6 +9,7 @@ different formats: - TGZ (.tar.gz) - TXZ (.tar.xz) - TZ (.tar.Z) + - TZST (.tar.zst) - ZIP (.zip) Variables specific to CPack Archive generator diff --git a/Help/release/dev/cpack-zstd.rst b/Help/release/dev/cpack-zstd.rst new file mode 100644 index 0000000..e1e64a2 --- /dev/null +++ b/Help/release/dev/cpack-zstd.rst @@ -0,0 +1,5 @@ +cpack-zstd +---------- + +* The :cpack_gen:`CPack Archive Generator` learned to generate `.tar.zst` + packages with Zstandard compression. diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx index e9338f2..1271b08 100644 --- a/Source/CPack/cmCPackArchiveGenerator.cxx +++ b/Source/CPack/cmCPackArchiveGenerator.cxx @@ -46,6 +46,12 @@ cmCPackGenerator* cmCPackArchiveGenerator::CreateTZGenerator() ".tar.Z"); } +cmCPackGenerator* cmCPackArchiveGenerator::CreateTZSTGenerator() +{ + return new cmCPackArchiveGenerator(cmArchiveWrite::CompressZstd, "paxr", + ".tar.zst"); +} + cmCPackGenerator* cmCPackArchiveGenerator::CreateZIPGenerator() { return new cmCPackArchiveGenerator(cmArchiveWrite::CompressNone, "zip", diff --git a/Source/CPack/cmCPackArchiveGenerator.h b/Source/CPack/cmCPackArchiveGenerator.h index 9bd1ede..f5be0aa 100644 --- a/Source/CPack/cmCPackArchiveGenerator.h +++ b/Source/CPack/cmCPackArchiveGenerator.h @@ -29,6 +29,7 @@ public: static cmCPackGenerator* CreateTGZGenerator(); static cmCPackGenerator* CreateTXZGenerator(); static cmCPackGenerator* CreateTZGenerator(); + static cmCPackGenerator* CreateTZSTGenerator(); static cmCPackGenerator* CreateZIPGenerator(); /** diff --git a/Source/CPack/cmCPackGeneratorFactory.cxx b/Source/CPack/cmCPackGeneratorFactory.cxx index f230871..4d41049 100644 --- a/Source/CPack/cmCPackGeneratorFactory.cxx +++ b/Source/CPack/cmCPackGeneratorFactory.cxx @@ -54,6 +54,8 @@ cmCPackGeneratorFactory::cmCPackGeneratorFactory() cmCPackArchiveGenerator::CreateTXZGenerator); this->RegisterGenerator("TZ", "Tar Compress compression", cmCPackArchiveGenerator::CreateTZGenerator); + this->RegisterGenerator("TZST", "Tar Zstandard compression", + cmCPackArchiveGenerator::CreateTZSTGenerator); this->RegisterGenerator("ZIP", "ZIP file format", cmCPackArchiveGenerator::CreateZIPGenerator); } -- cgit v0.12