summaryrefslogtreecommitdiff
path: root/Source/cmSystemTools.cxx
diff options
context:
space:
mode:
authorBartosz Kosiorek <bartosz.kosiorek@tomtom.com>2019-03-08 14:53:35 +0100
committerBartosz Kosiorek <bartosz.kosiorek@tomtom.com>2019-03-18 17:55:35 +0100
commit8634576dcb03087fc507b8012a47f1ecc852f65f (patch)
tree47418b14525ece43b52697e9a82c1129d157d813 /Source/cmSystemTools.cxx
parentc7c6a4a2cc06fd22eeb1c545dba030eddf39363a (diff)
downloadcmake-8634576dcb03087fc507b8012a47f1ecc852f65f.tar.gz
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.cxx10
1 files changed, 4 insertions, 6 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index d762106f09..41f8cf47bf 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;