Skip to content

Commit

Permalink
Skip over "." when creating directories
Browse files Browse the repository at this point in the history
This is causing issues with busybox.

Signed-off-by: Jon Johnson <[email protected]>
  • Loading branch information
jonjohnsonjr committed Jun 18, 2024
1 parent 713b8c6 commit 9bef363
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/apk/fs/memfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func (m *memFS) MkdirAll(path string, perm fs.FileMode) error {
traversed := make([]string, 0)
anode := m.tree
for _, part := range parts {
if part == "" {
if part == "" || part == "." {
continue
}
if anode.children == nil {
Expand Down
5 changes: 5 additions & 0 deletions pkg/build/busybox.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,12 @@ func installBusyboxLinks(fsys apkfs.FullFS, installed []*apk.InstalledPackage) e
if link == busybox || link == "" {
continue
}

dir := filepath.Dir(link)
if dir == "." {
continue
}

if err := fsys.MkdirAll(dir, 0755); err != nil {
return fmt.Errorf("creating directory %s: %w", dir, err)
}
Expand Down

0 comments on commit 9bef363

Please sign in to comment.