From 9bef363e21ac5f60f1e9703858df274d7ec33c22 Mon Sep 17 00:00:00 2001 From: Jon Johnson Date: Tue, 18 Jun 2024 13:08:28 -0700 Subject: [PATCH] Skip over "." when creating directories This is causing issues with busybox. Signed-off-by: Jon Johnson --- pkg/apk/fs/memfs.go | 2 +- pkg/build/busybox.go | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/apk/fs/memfs.go b/pkg/apk/fs/memfs.go index acce23933..a6e50b405 100644 --- a/pkg/apk/fs/memfs.go +++ b/pkg/apk/fs/memfs.go @@ -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 { diff --git a/pkg/build/busybox.go b/pkg/build/busybox.go index f47c28967..3a659b2e7 100644 --- a/pkg/build/busybox.go +++ b/pkg/build/busybox.go @@ -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) }