summaryrefslogtreecommitdiffstats
path: root/Source/cmFileCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-08-17 19:42:38 (GMT)
committerBrad King <brad.king@kitware.com>2006-08-17 19:42:38 (GMT)
commit0525d8be581276f3555c13116e6987b78aaf664e (patch)
treee9232b947a5bfc2f3b46f33a062ad38b5ddd7e34 /Source/cmFileCommand.cxx
parentfa70bf5b28f3c72bcdb0ea4caed4380006df1b65 (diff)
downloadCMake-0525d8be581276f3555c13116e6987b78aaf664e.zip
CMake-0525d8be581276f3555c13116e6987b78aaf664e.tar.gz
CMake-0525d8be581276f3555c13116e6987b78aaf664e.tar.bz2
BUG: Bundle installation needs all file permissions to be preserved from the build tree.
Diffstat (limited to 'Source/cmFileCommand.cxx')
-rw-r--r--Source/cmFileCommand.cxx14
1 files changed, 9 insertions, 5 deletions
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 9f2573e..9eca07b 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -318,7 +318,8 @@ bool cmFileCommand::HandleMakeDirectoryCommand(
//----------------------------------------------------------------------------
struct cmFileInstaller
{
- bool InstallFile(const char* fromFile, const char* toFile, bool always);
+ bool InstallFile(const char* fromFile, const char* toFile, bool always,
+ bool no_permissions);
bool InstallDirectory(const char* source,
const char* destination,
bool always,
@@ -334,7 +335,7 @@ struct cmFileInstaller
//----------------------------------------------------------------------------
bool cmFileInstaller::InstallFile(const char* fromFile, const char* toFile,
- bool always)
+ bool always, bool no_permissions)
{
// Inform the user about this file installation.
std::string message = "Installing ";
@@ -352,7 +353,10 @@ bool cmFileInstaller::InstallFile(const char* fromFile, const char* toFile,
}
// Set permissions of the destination file.
- if(!cmSystemTools::SetPermissions(toFile, this->FilePermissions))
+ // TODO: Take out no_permissions and replace with a user option to
+ // preserve source permissions explicitly.
+ if(!no_permissions &&
+ !cmSystemTools::SetPermissions(toFile, this->FilePermissions))
{
cmOStringStream e;
e << "Problem setting permissions on file \"" << toFile << "\"";
@@ -405,7 +409,7 @@ bool cmFileInstaller::InstallDirectory(const char* source,
std::string toFile = destination;
toFile += "/";
toFile += dir.GetFile(fileNum);
- if(this->InstallFile(fromPath.c_str(), toFile.c_str(), always))
+ if(this->InstallFile(fromPath.c_str(), toFile.c_str(), always, true))
{
smanifest_files += ";";
smanifest_files += toFile.substr(destDirLength);
@@ -1081,7 +1085,7 @@ bool cmFileCommand::HandleInstallCommand(
{
// Install this file.
if(!installer.InstallFile(fromFile.c_str(), toFile.c_str(),
- copy_always))
+ copy_always, false))
{
return false;
}