Skip to content

Commit 0e503ee

Browse files
authored
Fix handling of symlinks with missing targets in pallet file imports (#384)
* Fix handling of symlinks with missing targets in pallet file imports * Fix incorrect `CHANGELOG.md` update * Bump version number in `CHANGELOG.md`
1 parent 3a9b7d4 commit 0e503ee

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## 0.8.0-alpha.7 - 2024-03-05
9+
10+
### Fixed
11+
12+
- (cli) Symlinks to nonexistent targets no longer fail to be merged in as part of file imports from pallets.
13+
814
## 0.8.0-alpha.6 - 2024-01-27
915

1016
### Added

internal/app/forklift/pallets-merging.go

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -573,13 +573,24 @@ func matchUnderlayRef(
573573
name: path.Base(underlayTarget),
574574
ref: underlayRef,
575575
}
576-
if entry.fileInfo, err = fs.Stat(underlayRef.FS, underlayRef.Path); err != nil {
576+
if fsys, ok := underlayRef.FS.(ReadLinkFS); ok {
577+
if entry.fileInfo, err = fsys.StatLink(underlayRef.Path); err != nil {
578+
return nil, &fs.PathError{
579+
Op: "read",
580+
Path: fileName,
581+
Err: errors.Wrapf(
582+
err, "couldn't stat (without following symlinks) file %s in %s",
583+
entry.ref.Path, entry.ref.FS.Path(),
584+
),
585+
}
586+
}
587+
} /* else if entry.fileInfo, err = fs.Stat(underlayRef.FS, underlayRef.Path); err != nil {
577588
return nil, &fs.PathError{
578589
Op: "read",
579590
Path: fileName,
580591
Err: errors.Wrapf(err, "couldn't stat file %s in %s", entry.ref.Path, entry.ref.FS.Path()),
581592
}
582-
}
593+
}*/
583594
return entry, nil
584595
}
585596

0 commit comments

Comments
 (0)