[Cmake-commits] CMake branch, next, updated. v3.3.0-rc3-868-g32b7617

Brad King brad.king at kitware.com
Mon Jul 6 15:02:21 EDT 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  32b7617fd3128dc9f3c4e9198c80ad8ee9b1cc45 (commit)
       via  edae40239e64f8ea6c03d28601c9e7403a354f65 (commit)
      from  0c1569ccd5cf7fc7b05c255f85616db08b880a85 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=32b7617fd3128dc9f3c4e9198c80ad8ee9b1cc45
commit 32b7617fd3128dc9f3c4e9198c80ad8ee9b1cc45
Merge: 0c1569c edae402
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Jul 6 15:02:20 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Jul 6 15:02:20 2015 -0400

    Merge topic 'tar-portability' into next
    
    edae4023 cmArchiveWrite: do not store sparse files when using standard tar formats


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=edae40239e64f8ea6c03d28601c9e7403a354f65
commit edae40239e64f8ea6c03d28601c9e7403a354f65
Author:     Roman Donchenko <roman.donchenko at itseez.com>
AuthorDate: Mon Jul 6 17:54:19 2015 +0300
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Jul 6 15:01:08 2015 -0400

    cmArchiveWrite: do not store sparse files when using standard tar formats
    
    Sparse files in tars are a GNU extension that libarchive will use if it
    detects holes in the input file, even when using the standard pax/paxr
    formats. Not all tar implementations can handle sparse files; in particular,
    the internal implementation dpkg uses to extract packages can't. To
    maximize archive portability, turn this feature off by clearing the
    sparseness information from archive entries.

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;
 };

-----------------------------------------------------------------------

Summary of changes:
 Source/cmArchiveWrite.cxx |   11 ++++++++++-
 Source/cmArchiveWrite.h   |    1 +
 2 files changed, 11 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list