This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake".
The branch, next has been updated via 0fe79c067090dd880826e5334a30af955e15c5e2 (commit) via 98c72cdeccb98017e39438af8186811c8f998197 (commit) via 901dd53403db10b5c88be8c9ccd9fab3eaed1068 (commit) via 39347d38b42e28a53d9fa30cc1b78b6be7866878 (commit) via 480f526a9e9fc79d561cb5daf3b2457d797c0e6d (commit) from 527deefa0a4bede3d45edd867afe2a1a5eb8a7bd (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0fe79c067090dd880826e5334a30af955e15c5e2 commit 0fe79c067090dd880826e5334a30af955e15c5e2 Merge: 527deef 98c72cd Author: Domen Vrankar <domen.vran...@gmail.com> AuthorDate: Thu Sep 24 20:00:30 2015 -0400 Commit: CMake Topic Stage <kwro...@kitware.com> CommitDate: Thu Sep 24 20:00:30 2015 -0400 Merge topic 'cpack-empty-dirs-handling-fix' into next 98c72cde CPack: correctly handle directories creation 901dd534 SystemTools: time operations on directories 39347d38 SystemTools: set time file permissions 480f526a SystemTools: reverted handling of directories in copy file functions https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=98c72cdeccb98017e39438af8186811c8f998197 commit 98c72cdeccb98017e39438af8186811c8f998197 Author: Domen Vrankar <domen.vran...@gmail.com> AuthorDate: Fri Sep 25 01:35:46 2015 +0200 Commit: Domen Vrankar <domen.vran...@gmail.com> CommitDate: Fri Sep 25 01:35:46 2015 +0200 CPack: correctly handle directories creation diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 04b1976..49f9cb5 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -411,6 +411,33 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories( symlinkedFiles.push_back(std::pair<std::string, std::string>(targetFile,inFileRelative)); } + else if(cmSystemTools::FileIsDirectory(inFile)) + { + bool dirExists = cmSystemTools::FileExists(filePath); + mode_t perm = 0; + bool perms = cmSystemTools::GetPermissions(inFile, perm); + mode_t destPerm = 0; + bool destPerms = false; + + if(dirExists) + { + destPerms = cmSystemTools::GetPermissions(filePath, destPerm); + } + + // create only if dir doesn't exist or dirs differ + if(!dirExists || perms != destPerms || perm != destPerm) + { + if(!cmSystemTools::MakeDirectory(filePath) || + (perms && !cmSystemTools::SetPermissions(filePath, perm)) || + !cmSystemTools::CopyFileTime(inFile.c_str(), filePath.c_str())) + { + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Problem creating directory: " + << filePath << std::endl); + return 0; + } + } + } /* If it is not a symlink then do a plain copy */ else if (!( cmSystemTools::CopyFileIfDifferent(inFile.c_str(),filePath.c_str()) https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=901dd53403db10b5c88be8c9ccd9fab3eaed1068 commit 901dd53403db10b5c88be8c9ccd9fab3eaed1068 Author: Domen Vrankar <domen.vran...@gmail.com> AuthorDate: Fri Sep 25 01:25:42 2015 +0200 Commit: Domen Vrankar <domen.vran...@gmail.com> CommitDate: Fri Sep 25 01:33:10 2015 +0200 SystemTools: time operations on directories On windows FILE_FLAG_BACKUP_SEMANTICS enables us to read/write time both on files and directories. diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index fa84478..d3c1f16 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -2045,10 +2045,11 @@ bool cmSystemTools::CopyFileTime(const char* fromFile, const char* toFile) cmSystemToolsWindowsHandle hFrom = CreateFileW(SystemTools::ConvertToWindowsExtendedPath(fromFile).c_str(), GENERIC_READ, FILE_SHARE_READ, 0, - OPEN_EXISTING, 0, 0); + OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0); cmSystemToolsWindowsHandle hTo = CreateFileW(SystemTools::ConvertToWindowsExtendedPath(toFile).c_str(), - FILE_WRITE_ATTRIBUTES, 0, 0, OPEN_EXISTING, 0, 0); + FILE_WRITE_ATTRIBUTES, 0, 0, OPEN_EXISTING, + FILE_FLAG_BACKUP_SEMANTICS, 0); if(!hFrom || !hTo) { return false; @@ -2100,7 +2101,8 @@ bool cmSystemTools::FileTimeGet(const char* fname, cmSystemToolsFileTime* t) #if defined(_WIN32) && !defined(__CYGWIN__) cmSystemToolsWindowsHandle h = CreateFileW(SystemTools::ConvertToWindowsExtendedPath(fname).c_str(), - GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0); + GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, + FILE_FLAG_BACKUP_SEMANTICS, 0); if(!h) { return false; @@ -2127,7 +2129,8 @@ bool cmSystemTools::FileTimeSet(const char* fname, cmSystemToolsFileTime* t) #if defined(_WIN32) && !defined(__CYGWIN__) cmSystemToolsWindowsHandle h = CreateFileW(SystemTools::ConvertToWindowsExtendedPath(fname).c_str(), - FILE_WRITE_ATTRIBUTES, 0, 0, OPEN_EXISTING, 0, 0); + FILE_WRITE_ATTRIBUTES, 0, 0, OPEN_EXISTING, + FILE_FLAG_BACKUP_SEMANTICS, 0); if(!h) { return false; https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=39347d38b42e28a53d9fa30cc1b78b6be7866878 commit 39347d38b42e28a53d9fa30cc1b78b6be7866878 Author: Domen Vrankar <domen.vran...@gmail.com> AuthorDate: Fri Sep 25 01:23:35 2015 +0200 Commit: Domen Vrankar <domen.vran...@gmail.com> CommitDate: Fri Sep 25 01:32:16 2015 +0200 SystemTools: set time file permissions On Windows if file permissions are read only FILE_WRITE_ATTRIBUTES will enables us to get file handle and change file time. diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 2675066..fa84478 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -2048,7 +2048,7 @@ bool cmSystemTools::CopyFileTime(const char* fromFile, const char* toFile) OPEN_EXISTING, 0, 0); cmSystemToolsWindowsHandle hTo = CreateFileW(SystemTools::ConvertToWindowsExtendedPath(toFile).c_str(), - GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0); + FILE_WRITE_ATTRIBUTES, 0, 0, OPEN_EXISTING, 0, 0); if(!hFrom || !hTo) { return false; @@ -2127,7 +2127,7 @@ bool cmSystemTools::FileTimeSet(const char* fname, cmSystemToolsFileTime* t) #if defined(_WIN32) && !defined(__CYGWIN__) cmSystemToolsWindowsHandle h = CreateFileW(SystemTools::ConvertToWindowsExtendedPath(fname).c_str(), - GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0); + FILE_WRITE_ATTRIBUTES, 0, 0, OPEN_EXISTING, 0, 0); if(!h) { return false; https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=480f526a9e9fc79d561cb5daf3b2457d797c0e6d commit 480f526a9e9fc79d561cb5daf3b2457d797c0e6d Author: Domen Vrankar <domen.vran...@gmail.com> AuthorDate: Fri Sep 25 01:13:24 2015 +0200 Commit: Domen Vrankar <domen.vran...@gmail.com> CommitDate: Fri Sep 25 01:13:24 2015 +0200 SystemTools: reverted handling of directories in copy file functions diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index c24b5ea..2675066 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -895,33 +895,12 @@ std::string cmSystemTools::FileExistsInParentDirectories(const char* fname, bool cmSystemTools::cmCopyFile(const char* source, const char* destination) { - // FIXME remove if statement once kwsys SystemTools get support for - // source is directory handling in CopyFileAlways function - if(cmSystemTools::FileIsDirectory(source)) - { - return Superclass::MakeDirectory(destination); - } - return Superclass::CopyFileAlways(source, destination); } bool cmSystemTools::CopyFileIfDifferent(const char* source, const char* destination) { - // FIXME remove if statement once kwsys SystemTools get support for - // source is directory handling in CopyFileIfDifferent function - if(cmSystemTools::FileIsDirectory(source)) - { - if(SystemTools::FileExists(destination)) - { - return true; - } - else - { - return Superclass::MakeDirectory(destination); - } - } - return Superclass::CopyFileIfDifferent(source, destination); } ----------------------------------------------------------------------- Summary of changes: Source/CPack/cmCPackGenerator.cxx | 27 +++++++++++++++++++++++++++ Source/cmSystemTools.cxx | 32 +++++++------------------------- 2 files changed, 34 insertions(+), 25 deletions(-) hooks/post-receive -- CMake _______________________________________________ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/mailman/listinfo/cmake-commits