summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-04-14 02:57:14 (GMT)
committerBrad King <brad.king@kitware.com>2006-04-14 02:57:14 (GMT)
commitac242e319bb4a7d6d31f83752687ceb3ea6890a8 (patch)
tree804e96a5f013f2a1b1df5cb944ce81ec4048eec2
parentb8a589bb1d5e4d1e10d0da77048ca9522755095c (diff)
downloadCMake-ac242e319bb4a7d6d31f83752687ceb3ea6890a8.zip
CMake-ac242e319bb4a7d6d31f83752687ceb3ea6890a8.tar.gz
CMake-ac242e319bb4a7d6d31f83752687ceb3ea6890a8.tar.bz2
BUG: Fixed install rules to use copy-if-different.
-rw-r--r--Source/cmFileCommand.cxx10
1 files changed, 3 insertions, 7 deletions
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 2f87b33..2808c58 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -852,13 +852,9 @@ bool cmFileCommand::HandleInstallCommand(
permissions |= mode_world_read;
}
- // Remove the original file and try copying the new file.
- // TODO: This should be copy-if-different. Don't forget to
- // edit the destination file permissions, or compare files
- // first. This would need a new SystemTools::FilesDiffer that
- // does not read all of the files at once.
- cmSystemTools::RemoveFile(toFile.c_str());
- if(!cmSystemTools::CopyFileAlways(fromFile.c_str(), toFile.c_str()))
+ // Copy the file, but only if it has changed.
+ if(!cmSystemTools::CopyFileIfDifferent(fromFile.c_str(),
+ toFile.c_str()))
{
cmOStringStream e;
e << "INSTALL cannot copy file \"" << fromFile