mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-06-24 21:07:28 +02:00
[yabridgectl] Canonicalize when checking blacklist
As mentioned in #156.
This commit is contained in:
@@ -56,6 +56,8 @@ Versioning](https://semver.org/spec/v2.0.0.html).
|
|||||||
lead to a number of surprises. Yabridgectl will now print a warning upon
|
lead to a number of surprises. Yabridgectl will now print a warning upon
|
||||||
syncing when using the symlink installation method, and the feature will be
|
syncing when using the symlink installation method, and the feature will be
|
||||||
removed completely in yabridge 4.0.
|
removed completely in yabridge 4.0.
|
||||||
|
- Blacklisted symlinks and files contained within symlinked directories are now
|
||||||
|
handled correctly when syncing.
|
||||||
|
|
||||||
### Packaging notes
|
### Packaging notes
|
||||||
|
|
||||||
|
|||||||
@@ -348,7 +348,15 @@ pub fn index(directory: &Path, blacklist: &HashSet<&Path>) -> SearchIndex {
|
|||||||
for (file_idx, entry) in WalkDir::new(directory)
|
for (file_idx, entry) in WalkDir::new(directory)
|
||||||
.follow_links(true)
|
.follow_links(true)
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.filter_entry(|e| !blacklist.contains(e.path()))
|
.filter_entry(|e| {
|
||||||
|
// The blacklist entries are canonicalized to resolve symlinks and to normalize slashes,
|
||||||
|
// so we should do the same thing here as well
|
||||||
|
if let Ok(p) = e.path().canonicalize() {
|
||||||
|
!blacklist.contains(p.as_path())
|
||||||
|
} else {
|
||||||
|
true
|
||||||
|
}
|
||||||
|
})
|
||||||
.filter_map(|e| e.ok())
|
.filter_map(|e| e.ok())
|
||||||
.filter(|e| !e.file_type().is_dir())
|
.filter(|e| !e.file_type().is_dir())
|
||||||
.enumerate()
|
.enumerate()
|
||||||
|
|||||||
Reference in New Issue
Block a user