From ac242e319bb4a7d6d31f83752687ceb3ea6890a8 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 13 Apr 2006 22:57:14 -0400 Subject: BUG: Fixed install rules to use copy-if-different. --- Source/cmFileCommand.cxx | 10 +++------- 1 file 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 -- cgit v0.12