KWSys 2015-09-25 (dc4e4a55)

Extract upstream KWSys using the following shell commands.

$ git archive --prefix=upstream-kwsys/ dc4e4a55 | tar x
$ git shortlog --no-merges --abbrev=8 --format='%h %s' cfeb27cc..dc4e4a55
Ben Boeckel (1):
      dd466688 CTestCustom: use list(APPEND)

Domen Vrankar (1):
      dc4e4a55 SystemTools: Handle directories in CopyFile{Always,IfDifferent}
This commit is contained in:
KWSys Robot 2015-09-25 08:46:41 -04:00 committed by Brad King
parent 7de8f67af3
commit 29ad069472
2 changed files with 82 additions and 76 deletions

View File

@ -9,7 +9,6 @@
# resulting memory leaks are not logged by valgrind anyway. Therefore, we
# don't have to exclude it.
set(CTEST_CUSTOM_MEMCHECK_IGNORE
${CTEST_CUSTOM_MEMCHECK_IGNORE}
list(APPEND CTEST_CUSTOM_MEMCHECK_IGNORE
kwsys.testProcess-10
)

View File

@ -2365,14 +2365,20 @@ bool SystemTools::CopyFileAlways(const std::string& source, const std::string& d
}
mode_t perm = 0;
bool perms = SystemTools::GetPermissions(source, perm);
std::string real_destination = destination;
if(SystemTools::FileIsDirectory(source))
{
SystemTools::MakeDirectory(destination);
}
else
{
const int bufferSize = 4096;
char buffer[bufferSize];
// If destination is a directory, try to create a file with the same
// name as the source in that directory.
std::string real_destination = destination;
std::string destination_dir;
if(SystemTools::FileExists(destination) &&
SystemTools::FileIsDirectory(destination))
@ -2455,6 +2461,7 @@ bool SystemTools::CopyFileAlways(const std::string& source, const std::string& d
{
return false;
}
}
if ( perms )
{
if ( !SystemTools::SetPermissions(real_destination, perm) )