summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/SystemTools.hxx.in
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2008-12-18 15:43:24 (GMT)
committerDavid Cole <david.cole@kitware.com>2008-12-18 15:43:24 (GMT)
commit0fafdb7eb8b710594448d2ccf61d3896b4ea8a17 (patch)
tree6da65828ed75b5509f1d9e2e0b178022a689abb2 /Source/kwsys/SystemTools.hxx.in
parentf8c0dc27b56495a178cc711b594cd0f6395d942d (diff)
downloadCMake-0fafdb7eb8b710594448d2ccf61d3896b4ea8a17.zip
CMake-0fafdb7eb8b710594448d2ccf61d3896b4ea8a17.tar.gz
CMake-0fafdb7eb8b710594448d2ccf61d3896b4ea8a17.tar.bz2
BUG: Do not copy permissions of files when making the copy in an install rule. If the source file was read-only, this prevents the subsequent set of the destination file's modification time, making the copied file always different in time-stamp than the original and always installing a new file with a new time stamp (but the same content) causing unnecessary downstream incremental rebuilds. As part of this fix, add an optional copyPermissions parameter to the SystemTools routines CopyFileIfDifferent, CopyFileAlways, CopyAFile and CopyADirectory. The copyPermissions parameter defaults to true to preserve the behavior of these routines for existing callers.
Diffstat (limited to 'Source/kwsys/SystemTools.hxx.in')
-rw-r--r--Source/kwsys/SystemTools.hxx.in27
1 files changed, 18 insertions, 9 deletions
diff --git a/Source/kwsys/SystemTools.hxx.in b/Source/kwsys/SystemTools.hxx.in
index 1484b60..b092764 100644
--- a/Source/kwsys/SystemTools.hxx.in
+++ b/Source/kwsys/SystemTools.hxx.in
@@ -490,33 +490,42 @@ public:
/**
* Copy the source file to the destination file only
- * if the two files differ.
+ * if the two files differ. If the "copyPermissions"
+ * argument is true, the permissions of the copy are
+ * set to be the same as the permissions of the
+ * original.
*/
static bool CopyFileIfDifferent(const char* source,
- const char* destination);
-
+ const char* destination,
+ bool copyPermissions = true);
+
/**
* Compare the contents of two files. Return true if different
*/
static bool FilesDiffer(const char* source, const char* destination);
-
+
/**
* Return true if the two files are the same file
*/
static bool SameFile(const char* file1, const char* file2);
/**
- * Copy a file
+ * Copy a file. If the "copyPermissions" argument is true, the
+ * permissions of the copy are set to be the same as the permissions
+ * of the original.
*/
- static bool CopyFileAlways(const char* source, const char* destination);
+ static bool CopyFileAlways(const char* source, const char* destination,
+ bool copyPermissions = true);
/**
* Copy a file. If the "always" argument is true the file is always
* copied. If it is false, the file is copied only if it is new or
- * has changed.
+ * has changed. If the "copyPermissions" argument is true, the
+ * permissions of the copy are set to be the same as the permissions
+ * of the original.
*/
static bool CopyAFile(const char* source, const char* destination,
- bool always = true);
+ bool always = true, bool copyPermissions = true);
/**
* Copy content directory to another directory with all files and
@@ -525,7 +534,7 @@ public:
* are new are copied.
*/
static bool CopyADirectory(const char* source, const char* destination,
- bool always = true);
+ bool always = true, bool copyPermissions = true);
/**
* Remove a file