summaryrefslogtreecommitdiffstats
path: root/Source/cmFileCopier.cxx
diff options
context:
space:
mode:
authorJon Chronopoulos <patches@crondog.com>2019-08-17 02:47:19 (GMT)
committerJon Chronopoulos <patches@crondog.com>2019-08-17 02:47:19 (GMT)
commit891e670e59265468be74484302800dc1469e7eea (patch)
tree2ba148b7da5185b865470500da39beb88c5b377c /Source/cmFileCopier.cxx
parent6f1781c63ad58c3c84987dce7eee36668ed2ba57 (diff)
downloadCMake-891e670e59265468be74484302800dc1469e7eea.zip
CMake-891e670e59265468be74484302800dc1469e7eea.tar.gz
CMake-891e670e59265468be74484302800dc1469e7eea.tar.bz2
install: print reason of failure
Fixes: #19430
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 62f132d..da425a8 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;
}