diff options
author | Bartosz Kosiorek <bartosz.kosiorek@tomtom.com> | 2019-03-08 13:53:35 (GMT) |
---|---|---|
committer | Bartosz Kosiorek <bartosz.kosiorek@tomtom.com> | 2019-03-18 16:55:35 (GMT) |
commit | 8634576dcb03087fc507b8012a47f1ecc852f65f (patch) | |
tree | 47418b14525ece43b52697e9a82c1129d157d813 /Source/cmSystemTools.cxx | |
parent | c7c6a4a2cc06fd22eeb1c545dba030eddf39363a (diff) | |
download | CMake-8634576dcb03087fc507b8012a47f1ecc852f65f.zip CMake-8634576dcb03087fc507b8012a47f1ecc852f65f.tar.gz CMake-8634576dcb03087fc507b8012a47f1ecc852f65f.tar.bz2 |
cmake: Don't interrupt archive creation if unable to read a file.
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.
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r-- | Source/cmSystemTools.cxx | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index d762106..41f8cf4 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1658,20 +1658,18 @@ bool cmSystemTools::CreateTar(const char* outFileName, a.SetMTime(mtime); a.SetVerbose(verbose); + bool tarCreatedSuccessfully = true; for (auto path : files) { if (cmSystemTools::FileIsFullPath(path)) { // Get the relative path to the file. path = cmSystemTools::RelativePath(cwd, path); } if (!a.Add(path)) { - break; + cmSystemTools::Error(a.GetError()); + tarCreatedSuccessfully = false; } } - if (!a) { - cmSystemTools::Error(a.GetError()); - return false; - } - return true; + return tarCreatedSuccessfully; #else (void)outFileName; (void)files; |