summaryrefslogtreecommitdiffstats
path: root/Source/cmFileCopier.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-08-21 15:55:01 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-08-21 15:55:58 (GMT)
commitea4c3976fb593d0daf49c52e0a42818cd743b9ff (patch)
tree30cb128eefdbefc40004574ebff179a0dfc257bd /Source/cmFileCopier.cxx
parentbd3f088abe6488dbc84197bf695a74bb8e8ddda4 (diff)
parent891e670e59265468be74484302800dc1469e7eea (diff)
downloadCMake-ea4c3976fb593d0daf49c52e0a42818cd743b9ff.zip
CMake-ea4c3976fb593d0daf49c52e0a42818cd743b9ff.tar.gz
CMake-ea4c3976fb593d0daf49c52e0a42818cd743b9ff.tar.bz2
Merge topic 'install-fail-reason'
891e670e59 install: print reason of failure Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Alex Turbov <i.zaufi@gmail.com> Merge-request: !3696
Diffstat (limited to 'Source/cmFileCopier.cxx')
-rw-r--r--Source/cmFileCopier.cxx21
1 files changed, 13 insertions, 8 deletions
diff --git a/Source/cmFileCopier.cxx b/Source/cmFileCopier.cxx
index 1d66050..2e54b88 100644
--- a/Source/cmFileCopier.cxx
+++ b/Source/cmFileCopier.cxx
@@ -91,7 +91,8 @@ bool cmFileCopier::SetPermissions(const std::string& toFile,
if (!cmSystemTools::SetPermissions(toFile, permissions)) {
std::ostringstream e;
- e << this->Name << " cannot set permissions on \"" << toFile << "\"";
+ e << this->Name << " cannot set permissions on \"" << toFile
+ << "\": " << cmSystemTools::GetLastSystemError() << ".";
this->Status.SetError(e.str());
return false;
}
@@ -121,7 +122,8 @@ bool cmFileCopier::ReportMissing(const std::string& fromFile)
{
// The input file does not exist and installation is not optional.
std::ostringstream e;
- e << this->Name << " cannot find \"" << fromFile << "\".";
+ e << this->Name << " cannot find \"" << fromFile
+ << "\": " << cmSystemTools::GetLastSystemError() << ".";
this->Status.SetError(e.str());
return false;
}
@@ -514,7 +516,8 @@ bool cmFileCopier::InstallSymlinkChain(std::string& fromFile,
if (!cmSystemTools::CreateSymlink(symlinkTarget, toFile)) {
std::ostringstream e;
- e << this->Name << " cannot create symlink \"" << toFile << "\".";
+ e << this->Name << " cannot create symlink \"" << toFile
+ << "\": " << cmSystemTools::GetLastSystemError() << ".";
this->Status.SetError(e.str());
return false;
}
@@ -535,7 +538,8 @@ bool cmFileCopier::InstallSymlink(const std::string& fromFile,
if (!cmSystemTools::ReadSymlink(fromFile, symlinkTarget)) {
std::ostringstream e;
e << this->Name << " cannot read symlink \"" << fromFile
- << "\" to duplicate at \"" << toFile << "\".";
+ << "\" to duplicate at \"" << toFile
+ << "\": " << cmSystemTools::GetLastSystemError() << ".";
this->Status.SetError(e.str());
return false;
}
@@ -566,7 +570,8 @@ bool cmFileCopier::InstallSymlink(const std::string& fromFile,
if (!cmSystemTools::CreateSymlink(symlinkTarget, toFile)) {
std::ostringstream e;
e << this->Name << " cannot duplicate symlink \"" << fromFile
- << "\" at \"" << toFile << "\".";
+ << "\" at \"" << toFile
+ << "\": " << cmSystemTools::GetLastSystemError() << ".";
this->Status.SetError(e.str());
return false;
}
@@ -595,7 +600,7 @@ bool cmFileCopier::InstallFile(const std::string& fromFile,
if (copy && !cmSystemTools::CopyAFile(fromFile, toFile, true)) {
std::ostringstream e;
e << this->Name << " cannot copy file \"" << fromFile << "\" to \""
- << toFile << "\".";
+ << toFile << "\": " << cmSystemTools::GetLastSystemError() << ".";
this->Status.SetError(e.str());
return false;
}
@@ -611,7 +616,7 @@ bool cmFileCopier::InstallFile(const std::string& fromFile,
if (!cmFileTimes::Copy(fromFile, toFile)) {
std::ostringstream e;
e << this->Name << " cannot set modification time on \"" << toFile
- << "\"";
+ << "\": " << cmSystemTools::GetLastSystemError() << ".";
this->Status.SetError(e.str());
return false;
}
@@ -648,7 +653,7 @@ bool cmFileCopier::InstallDirectory(const std::string& source,
if (!cmSystemTools::MakeDirectory(destination, default_dir_mode)) {
std::ostringstream e;
e << this->Name << " cannot make directory \"" << destination
- << "\": " << cmSystemTools::GetLastSystemError();
+ << "\": " << cmSystemTools::GetLastSystemError() << ".";
this->Status.SetError(e.str());
return false;
}