[Cmake-commits] CMake branch, master, updated. v2.8.5-391-g527a40f
KWSys Robot
kwrobot at kitware.com
Tue Sep 6 13:20:04 EDT 2011
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, master has been updated
via 527a40f06fc7f0ea6aa9c1fe96fb0fe5611fa633 (commit)
from 98cb017a9deca35cd9a67e03b6bd95064b6d2fb7 (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 -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=527a40f06fc7f0ea6aa9c1fe96fb0fe5611fa633
commit 527a40f06fc7f0ea6aa9c1fe96fb0fe5611fa633
Author: David Cole <david.cole at kitware.com>
AuthorDate: Tue Sep 6 13:12:03 2011 -0400
Commit: David Cole <david.cole at kitware.com>
CommitDate: Tue Sep 6 13:20:02 2011 -0400
KWSys: Add symlinks to directories as files (#12284)
This behaviour was previously broken; regardless of the
RecurseThroughSymLinks value, symlinks to directories were
NEVER added as files in the results.
When RecurseThroughSymLinks is ON, symlinks to directories
should be recursed as if they were the actual directories
to gather the files within.
However, when RecurseThroughSymLinks is OFF, symlinks to
directories should be returned as files in the result.
Inspired-by: Johan Björk <phb at spotify.com>
diff --git a/Source/kwsys/Glob.cxx b/Source/kwsys/Glob.cxx
index b33b926..513eb64 100644
--- a/Source/kwsys/Glob.cxx
+++ b/Source/kwsys/Glob.cxx
@@ -259,26 +259,23 @@ void Glob::RecurseDirectory(kwsys_stl::string::size_type start,
}
bool isDir = kwsys::SystemTools::FileIsDirectory(realname.c_str());
+ bool isSymLink = kwsys::SystemTools::FileIsSymlink(realname.c_str());
- if ( !isDir )
+ if ( isDir && (!isSymLink || this->RecurseThroughSymlinks) )
{
- if ( (this->Internals->Expressions.size() > 0) &&
- this->Internals->Expressions[
- this->Internals->Expressions.size()-1].find(fname.c_str()) )
+ if (isSymLink)
{
- this->AddFile(this->Internals->Files, realname.c_str());
+ ++this->FollowedSymlinkCount;
}
+ this->RecurseDirectory(start+1, realname);
}
else
{
- bool isSymLink = kwsys::SystemTools::FileIsSymlink(realname.c_str());
- if (!isSymLink || this->RecurseThroughSymlinks)
+ if ( (this->Internals->Expressions.size() > 0) &&
+ this->Internals->Expressions[
+ this->Internals->Expressions.size()-1].find(fname.c_str()) )
{
- if (isSymLink)
- {
- ++this->FollowedSymlinkCount;
- }
- this->RecurseDirectory(start+1, realname);
+ this->AddFile(this->Internals->Files, realname.c_str());
}
}
}
-----------------------------------------------------------------------
Summary of changes:
Source/kwsys/Glob.cxx | 21 +++++++++------------
1 files changed, 9 insertions(+), 12 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list