misc/getfiles: fix zst fallback
The previous symlink recursion fix broke the fallback for zst by
returning early.
Fixes 7a07a16ecb
Part-of: https://gitlab.postmarketos.org/postmarketOS/postmarketos-mkinitfs/-/merge_requests/67
[ci:skip-build]: already built successfully in CI
This commit is contained in:
@@ -47,14 +47,14 @@ func getFile(file string, required bool) (files []string, err error) {
|
||||
// 2) set file to dereferenced target
|
||||
// 4) continue this function to either walk it if the target is a dir or add the
|
||||
// target to the list of files
|
||||
if s, err := os.Lstat(file); err != nil {
|
||||
return files, err
|
||||
} else if s.Mode()&fs.ModeSymlink != 0 {
|
||||
files = append(files, file)
|
||||
if target, err := filepath.EvalSymlinks(file); err != nil {
|
||||
return files, err
|
||||
} else {
|
||||
file = target
|
||||
if s, err := os.Lstat(file); err == nil {
|
||||
if s.Mode()&fs.ModeSymlink != 0 {
|
||||
files = append(files, file)
|
||||
if target, err := filepath.EvalSymlinks(file); err != nil {
|
||||
return files, err
|
||||
} else {
|
||||
file = target
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user