mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-03 12:49:50 -05: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) {
|
for (std::string const& gf : this->files) {
|
||||||
bool skip = false;
|
bool skip = false;
|
||||||
std::string inFile = gf;
|
std::string inFile = gf;
|
||||||
if (cmSystemTools::FileIsDirectory(gf)) {
|
if (cmSystemTools::FileIsDirectory(gf) &&
|
||||||
|
!cmSystemTools::FileIsSymlink(gf)) {
|
||||||
inFile += '/';
|
inFile += '/';
|
||||||
}
|
}
|
||||||
for (cmsys::RegularExpression& reg : ignoreFilesRegex) {
|
for (cmsys::RegularExpression& reg : ignoreFilesRegex) {
|
||||||
|
|||||||
Reference in New Issue
Block a user