summaryrefslogtreecommitdiffstats
path: root/Source/cmArchiveWrite.cxx
Commit message (Collapse)AuthorAgeFilesLines
* cmake: Teach "-E tar" command a "--format=" optionNils Gladitz2015-04-101-31/+13
| | | | | | | Allows specifying a libarchive defined archive format currently restricted to 7zip, gnutar, pax, paxr and zip. The default is "paxr" (pax restricted).
* Merge branch 'backport-no-global-setlocale' into no-global-setlocaleBrad King2015-02-061-0/+4
|\ | | | | | | Resolve conflict in Source/CMakeLists.txt by taking both changes.
| * Add setlocale() calls around use of libarchive APIs (#14934, #15377)Brad King2015-02-061-0/+4
| | | | | | | | | | | | | | | | | | | | The libarchive APIs use nl_langinfo(CODESET) for iconv so they need the locale to be set for LC_CTYPE. However, the rest of CMake does not define any behavior for non-ASCII character classification/conversion so we do not want to setlocale() globally. Add a RAII class to save, set, and restore the locale around calls to libarchive APIs. Inspired-by: Clinton Stimpson <clinton@elemtech.com>
* | cmake: Teach "-E tar" command a "--mtime=" optionBrad King2015-01-191-0/+15
| | | | | | | | | | | | | | | | | | | | Add an option to set the mtime of entries in a tarball so that one can create a tarball with a consistent content hash (e.g. MD5) for a given set of files regardless of their current timestamps on disk. This will be useful for submission of tarballs to CDash, which tracks content hashes to avoid duplication. Inspired-by: Bill Hoffman <bill.hoffman@kitware.com>
* | cmake: Teach "-E tar" to report file name on failure to read from diskBrad King2015-01-191-1/+3
|/ | | | | | The libarchive-provided error message does not always include the file name, so add it to the message ourselves to ensure users know which file fails.
* CPack: add generators for .7z and .tar.xz (#13072, #14519)Daniel Pfeifer2014-07-291-1/+9
|
* Encoding: Fix potential encoding issues with libarchive on Windows.Clinton Stimpson2014-07-021-2/+24
| | | | | | | | | | Because the 8bit string encoding in libarchive can be different than the 8bit string encoding in CMake, change to call the wide version of libarchive functions. They are different if CMake is configured to use UTF-8 as the internal encoding. Create helper functions for some libarchive calls to use wstring internally on platforms supporting it.
* Merge topic 'archive-null-error'Brad King2014-04-171-14/+21
|\ | | | | | | | | b508de59 cmArchiveWrite: Handle NULL error string (#14882)
| * cmArchiveWrite: Handle NULL error string (#14882)Brad King2014-04-161-14/+21
| | | | | | | | | | If archive_error_string returns NULL, use a placeholder string instead of crashing.
* | Use cmsys::[io]fstream instead of cmsys_ios::[io]fstream.Clinton Stimpson2014-01-071-1/+2
|/ | | | | Also use SystemTools::Fopen() instead of fopen(). This is to eventually support utf-8 filenames.
* cmArchiveWrite: Clear fflags from archive entriesBrad King2012-06-061-0/+1
| | | | | | | | | | | When reading archive entries from disk strip any "fflags" entry headers that may have been loaded from the filesystem when libarchive is built with HAVE_STRUCT_STAT_ST_FLAGS (struct stat has 'st_flags'). The local filesystem flags are not useful for distribution. Furthermore, GNU tar does not understand the "SCHILY.fflags" extended header used to store the flags in the archive. Use the approach from commit e8558efa (cmArchiveWrite: Clear xattr and acl from entries, 2011-04-07) to remove the flags and avoid producing the non-portable extended header.
* Do not add the content of a file if it's a symlink.Eric NOULARD2012-01-131-3/+7
| | | | | | | This wasn't necessary for TAR-like (TGZ, TBZ2, etc...) archive because for those the size was 0. Either there is an error in upstream libarchive concerning the size or we should not rely on size of the entry for adding content.
* CMake: Write symlinks to directories as files in archives (#12284)Johan Björk2011-09-061-1/+2
| | | | | | | | | | | Do not recurse through directory symlinks when adding files. Recursing through directory symlinks will generate broken archives, i.e., they will look something like this: foo -> bar/bar foo/Info <- Shouldn't be in archive. bar/bar bar/bar/Info
* cmArchiveWrite: Clear xattr and acl from entries (#11958)Brad King2011-04-071-0/+3
| | | | | | | | | | | | When reading archive entries from disk strip any xattr and acl entry headers that may have been loaded from the filesystem (e.g. selinux). These fields are only useful for backup tools and not for packaging and distribution of software. Furthermore, the GNU tar 1.15.1 on at least one Linux distribution treats unknown entry headers as an error rather than a warning. Therefore avoiding such fields is necessary for archive portability. Suggested-by: Tim Kientzle <tim@kientzle.com>
* Add Compress compress support to libarchive-wrapperEric NOULARD2010-08-161-0/+8
|
* Add XZ compress support to libarchive-wrapperEric NOULARD2010-08-131-0/+8
| | | | | | | This is not needed but it does not cost much to do it for all potentially supported format in libarchive. XZ and LZMA are not builtin libarchive and require external lib but if CMAKE_USE_SYSTEM_LIBARCHIVE is ON then we may get it for free.
* Add ZIP archive format and LZMA compress support to libarchive-wrapperEric NOULARD2010-08-131-4/+40
| | | | | | | This will be needed to use cmArchiveWrire in cmCPackArchiveGenerator with the same feature set as before. Note that adding zip support to libarchive-wrapper would also makes it easy to add a new -E zip command to cmake commands.
* cmArchiveWrite: Fix signed/unsigned againBrad King2010-08-111-7/+7
| | | | | | Some stream libraries return size_t from gcount() and some return ssize_t. Add an explicit cast to ios::streamsize for its return value. Also refactor use of nnext to reduce the use of casts.
* cmArchiveWrite: Fix signed/unsigned compare/convertBrad King2010-08-091-4/+8
| | | | | | | | The libarchive interface accepts size_t but returns ssize_t. The std streams interface wants streamsize, which is typically ssize_t. Since no one type for our variable matches without conversions, make the conversions explicit to avoid -Wsign-conversion and -Wsign-compare warnings.
* Create class cmArchiveWrite to wrap libarchive (#11020)Brad King2010-08-061-0/+243