Skip to content

Commit

Permalink
Merge pull request #1172 from jonjohnsonjr/busybox-links
Browse files Browse the repository at this point in the history
Skip over "." when creating directories
  • Loading branch information
jonjohnsonjr authored Jun 18, 2024
2 parents 713b8c6 + 9bef363 commit a2b5a71
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 a2b5a71

Please sign in to comment.