summaryrefslogtreecommitdiffstats
path: root/Source/cmArchiveWrite.cxx
Commit message (Collapse)AuthorAgeFilesLines
* CPack: Use SOURCE_DATE_EPOCH for all timestamps in archivesBen Stone2020-06-021-0/+5
|
* Refactoring: Third-parties public headers are under cm3p prefixMarc Chevrier2020-05-071-1/+3
| | | | Fixes: #20666
* cmArchiveWrite: support setting archive filter optionsBen Boeckel2020-03-311-0/+13
|
* cmArchiveWrite: split out opening the fileBen Boeckel2020-03-311-1/+5
| | | | | This allows options to be set before the "header" phase of libarchive's API.
* cmArchiveWrite: Remove ./ suffix from 7zip archivesCristian Adam2020-01-311-2/+3
| | | | Fixes: #20297
* cmArchiveWrite: Remove ./ suffix from zip archivesCristian Adam2020-01-271-2/+7
| | | | Fixes: #20238
* Revise include order using clang-format-6.0Kitware Robot2019-10-011-9/+11
| | | | | Run the `clang-format.bash` script to update our C and C++ code to a new include order `.clang-format`. Use `clang-format` version 6.0.
* clang-tidy: modernize-deprecated-headersRegina Pfeifer2019-09-161-2/+2
|
* clang-tidy: Replace typedef with usingRegina Pfeifer2019-09-031-1/+1
|
* Source sweep: Use cmStrCat for string concatenationSebastian Holtermann2019-08-221-47/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is generated by a python script that uses regular expressions to search for string concatenation patterns of the kind ``` std::string str = <ARG0>; str += <ARG1>; str += <ARG2>; ... ``` and replaces them with a single `cmStrCat` call ``` std::string str = cmStrCat(<ARG0>, <ARG1>, <ARG2>, ...); ``` If any `<ARGX>` is itself a concatenated string of the kind ``` a + b + c + ...; ``` then `<ARGX>` is split into multiple arguments for the `cmStrCat` call. If there's a sequence of literals in the `<ARGX>`, then all literals in the sequence are concatenated and merged into a single literal argument for the `cmStrCat` call. Single character strings are converted to single char arguments for the `cmStrCat` call. `std::to_string(...)` wrappings are removed from `cmStrCat` arguments, because it supports numeric types as well as string types. `arg.substr(x)` arguments to `cmStrCat` are replaced with `cm::string_view(arg).substr(x)`
* cmake: Teach cmake -E tar command, Zstandard compressionBartosz Kosiorek2019-05-221-0/+7
| | | | Fixes #18657
* cmake: Don't interrupt archive creation if unable to read a file.Bartosz Kosiorek2019-03-181-6/+5
| | | | | | | | | | | Rationale: Currently during creation of archive by 'tar', if error appears, it interrupt archive creation. As a result only part of files are archived This behaviour is not consistent with 'copy_directory', native 'tar' and other command behaviour. With this Merge Request this behaviour is fixed.
* Delete some default constructors and assignment operatorsAlbert Astals Cid2019-02-151-0/+2
| | | | | | They are unused, but if someone used them they would lead to problems since they would copy the internal raw pointers and the destructor would cause double delete
* Fix most clang -Wextra-semi-stmt warnings in C++ filesSean McBride2019-01-151-1/+1
| | | | Suppress one in code generated by flex.
* Using front() and back() instead of calculationsCengizhan Pasaoglu2018-11-061-1/+1
|
* CPack/Deb: Support SOURCE_DATE_EPOCH when packaging filesAndrew Fuller2018-07-251-2/+26
|
* Revise C++ coding style using clang-format-6.0Kitware Robot2018-06-011-1/+1
| | | | | | | | | | | | Run the `clang-format.bash` script to update all our C and C++ code to a new style defined by `.clang-format`. Use `clang-format` version 6.0. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit.
* Use C++11 nullptrDaniel Pfeifer2017-08-241-3/+3
|
* Use quotes for non-system includesDaniel Pfeifer2017-04-111-4/+4
| | | | | | | | | | | | | Automate with: git grep -l '#include <cm_' -- Source \ | xargs sed -i 's/#include <\(cm_.*\)>/#include "\1"/g' git grep -l '#include <cmsys/' -- Source \ | xargs sed -i 's/#include <\(cmsys\/.*\)>/#include "\1"/g' git grep -l '#include <cm[A-Z]' -- Source \ | xargs sed -i 's/#include <\(cm[A-Z].*\)>/#include "\1"/g'
* Simplify CMake per-source license noticesBrad King2016-09-271-11/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Per-source copyright/license notice headers that spell out copyright holder names and years are hard to maintain and often out-of-date or plain wrong. Precise contributor information is already maintained automatically by the version control tool. Ultimately it is the receiver of a file who is responsible for determining its licensing status, and per-source notices are merely a convenience. Therefore it is simpler and more accurate for each source to have a generic notice of the license name and references to more detailed information on copyright holders and full license terms. Our `Copyright.txt` file now contains a list of Contributors whose names appeared source-level copyright notices. It also references version control history for more precise information. Therefore we no longer need to spell out the list of Contributors in each source file notice. Replace CMake per-source copyright/license notice headers with a short description of the license and links to `Copyright.txt` and online information available from "https://cmake.org/licensing". The online URL also handles cases of modules being copied out of our source into other projects, so we can drop our notices about replacing links with full license text. Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority of the replacements mechanically. Manually fix up shebang lines and trailing newlines in a few files. Manually update the notices in a few files that the script does not handle.
* Merge topic 'else-after-return'Brad King2016-08-231-2/+1
|\ | | | | | | | | | | | | | | 7b6349da CMake: don't use else after return 50ad1e0a CTest: don't use else after return 7f97a6c9 CPack: don't use else after return 4988b914 CursesDialog: don't use else after return
| * CMake: don't use else after returnDaniel Pfeifer2016-08-181-2/+1
| |
* | fix a batch of include-what-you-use violationsDaniel Pfeifer2016-08-231-0/+4
| |
* | cmArchiveWrite: replace mode_t with intDaniel Pfeifer2016-08-171-1/+1
|/ | | | | | | | Rationale: * mode_t is not defined on all platforms * bitmasking (operator &) promotes the value to an int anyway * libarchive uses int in the public api starting with version 4
* Make sure unnused parameters are /*named*/Daniel Pfeifer2016-08-161-1/+2
|
* use CM_NULLPTRDaniel Pfeifer2016-06-281-3/+4
|
* Use the empty() method to check for emptyness.Daniel Pfeifer2016-06-021-1/+1
| | | | | Apply fix-its from clang-tidy's readability-container-size-empty checker.
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-145/+103
| | | | | | | | | | | | | Run the `Utilities/Scripts/clang-format.bash` script to update all our C++ code to a new style defined by `.clang-format`. Use `clang-format` version 3.8. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit.
* Remove `//------...` horizontal separator commentsBrad King2016-05-091-11/+0
| | | | | | | | | | | | | | | | | | | | | | | | Modern editors provide plenty of ways to visually separate functions. Drop the explicit comments that previously served this purpose. Use the following command to automate the change: $ git ls-files -z -- \ "*.c" "*.cc" "*.cpp" "*.cxx" "*.h" "*.hh" "*.hpp" "*.hxx" | egrep -z -v "^Source/cmCommandArgumentLexer\." | egrep -z -v "^Source/cmCommandArgumentParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmDependsJavaLexer\." | egrep -z -v "^Source/cmDependsJavaParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmExprLexer\." | egrep -z -v "^Source/cmExprParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmFortranLexer\." | egrep -z -v "^Source/cmFortranParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmListFileLexer\." | egrep -z -v "^Source/cm_sha2" | egrep -z -v "^Source/(kwsys|CursesDialog/form)/" | egrep -z -v "^Utilities/(KW|cm).*/" | xargs -0 sed -i '/^\(\/\/---*\|\/\*---*\*\/\)$/ {d;}' This avoids modifying third-party sources and generated sources.
* Format include directive blocks and ordering with clang-formatBrad King2016-04-291-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sort include directives within each block (separated by a blank line) in lexicographic order (except to prioritize `sys/types.h` first). First run `clang-format` with the config file: --- SortIncludes: false ... Commit the result temporarily. Then run `clang-format` again with: --- SortIncludes: true IncludeCategories: - Regex: 'sys/types.h' Priority: -1 ... Commit the result temporarily. Start a new branch and cherry-pick the second commit. Manually resolve conflicts to preserve indentation of re-ordered includes. This cleans up the include ordering without changing any other style. Use the following command to run `clang-format`: $ git ls-files -z -- \ '*.c' '*.cc' '*.cpp' '*.cxx' '*.h' '*.hh' '*.hpp' '*.hxx' | egrep -z -v '(Lexer|Parser|ParserHelper)\.' | egrep -z -v '^Source/cm_sha2' | egrep -z -v '^Source/(kwsys|CursesDialog/form)/' | egrep -z -v '^Utilities/(KW|cm).*/' | egrep -z -v '^Tests/Module/GenerateExportHeader' | egrep -z -v '^Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h' | xargs -0 clang-format -i This selects source files that do not come from a third-party. Inspired-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
* cmArchiveWrite: Preemptively adapt to future libarchive 4.0 changesBrad King2015-10-281-0/+4
|
* cmArchiveWrite: control user/group, permissions and recursive file addingRaffi Enficiaud2015-09-171-4/+35
|
* Merge topic 'libarchive-modern-apis'Brad King2015-08-251-14/+14
|\ | | | | | | | | e7f93715 Use modern libarchive APIs
| * Use modern libarchive APIsPáder Rezső2015-08-241-14/+14
| | | | | | | | | | Replace use of deprecated libarchive3 functions with their modern equivalents.
* | Remove use of include <cmsys/ios/*> and cmsys_ios::*Brad King2015-08-201-4/+3
|/ | | | We no longer need this compatibility layer for the compilers we support.
* cmArchiveWrite: do not store sparse files when using standard tar formatsRoman Donchenko2015-07-061-1/+10
| | | | | | | | | 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.
* 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>