diff options
author | Brad King <brad.king@kitware.com> | 2015-07-07 13:53:52 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2015-07-07 13:53:52 (GMT) |
commit | 86bbcdfeb8ca692c5af9e3f29887cb82de9260b7 (patch) | |
tree | ee14fa7faf113d626430d0b483e08fb87ae78a17 /Source | |
parent | 2a249d734b16a05ac09bd44573b015e024ad276b (diff) | |
parent | edae40239e64f8ea6c03d28601c9e7403a354f65 (diff) | |
download | CMake-86bbcdfeb8ca692c5af9e3f29887cb82de9260b7.zip CMake-86bbcdfeb8ca692c5af9e3f29887cb82de9260b7.tar.gz CMake-86bbcdfeb8ca692c5af9e3f29887cb82de9260b7.tar.bz2 |
Merge topic 'tar-portability'
edae4023 cmArchiveWrite: do not store sparse files when using standard tar formats
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmArchiveWrite.cxx | 11 | ||||
-rw-r--r-- | Source/cmArchiveWrite.h | 1 |
2 files changed, 11 insertions, 1 deletions
diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx index 72818f5..44d0d4e 100644 --- a/Source/cmArchiveWrite.cxx +++ b/Source/cmArchiveWrite.cxx @@ -84,7 +84,8 @@ cmArchiveWrite::cmArchiveWrite( Stream(os), Archive(archive_write_new()), Disk(archive_read_disk_new()), - Verbose(false) + Verbose(false), + Format(format) { switch (c) { @@ -282,6 +283,14 @@ bool cmArchiveWrite::AddFile(const char* file, archive_entry_acl_clear(e); archive_entry_xattr_clear(e); archive_entry_set_fflags(e, 0, 0); + + if (this->Format == "pax" || this->Format == "paxr") + { + // Sparse files are a GNU tar extension. + // Do not use them in standard tar files. + archive_entry_sparse_clear(e); + } + if(archive_write_header(this->Archive, e) != ARCHIVE_OK) { this->Error = "archive_write_header: "; diff --git a/Source/cmArchiveWrite.h b/Source/cmArchiveWrite.h index 794cb28..e6f515d 100644 --- a/Source/cmArchiveWrite.h +++ b/Source/cmArchiveWrite.h @@ -84,6 +84,7 @@ private: struct archive* Archive; struct archive* Disk; bool Verbose; + std::string Format; std::string Error; std::string MTime; }; |