mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-11 16:32:14 -06:00
CPack: Fix symbolic link detection for directories
In the case where the current path is a symlink to a directory, a trailing slash causes the link to be dereferenced, which means that any subsequent `FileIsSymlink` on it will return false. Fixes: #21886
This commit is contained in:
committed by
Brad King
parent
1dde7e350a
commit
c456b09513
@@ -384,7 +384,8 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
|
||||
for (std::string const& gf : this->files) {
|
||||
bool skip = false;
|
||||
std::string inFile = gf;
|
||||
if (cmSystemTools::FileIsDirectory(gf)) {
|
||||
if (cmSystemTools::FileIsDirectory(gf) &&
|
||||
!cmSystemTools::FileIsSymlink(gf)) {
|
||||
inFile += '/';
|
||||
}
|
||||
for (cmsys::RegularExpression& reg : ignoreFilesRegex) {
|
||||
|
||||
Reference in New Issue
Block a user