Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pkg/apk/fs/memfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ func NewMemFS() FullFS {
}
}

func (m *memFS) String() string {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could potentially add this function to the FullFS interface, but this would be a breaking change, WDYT?

return "memfs"
}

// getNode returns the node for the given path. If the path is not found, it
// returns an error.
func (m *memFS) getNode(path string) (*node, error) {
Expand Down
4 changes: 4 additions & 0 deletions pkg/apk/fs/rwosfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,10 @@ type dirFS struct {
caseMapMutex sync.Mutex
}

func (f *dirFS) String() string {
return fmt.Sprintf("dirfs:%s", f.base)
}

func (f *dirFS) Readlink(name string) (string, error) {
// The underlying filesystem might not support symlinks, and it might be case-insensitive, so just
// use the one in memory.
Expand Down
5 changes: 5 additions & 0 deletions pkg/apk/fs/sub.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package fs

import (
"errors"
"fmt"
"io/fs"
"path/filepath"
"time"
Expand All @@ -12,6 +13,10 @@ type SubFS struct {
Root string
}

func (s *SubFS) String() string {
return fmt.Sprintf("%s:%s", s.FS, s.Root)
}

func (s *SubFS) Open(path string) (fs.File, error) {
if !fs.ValidPath(path) {
return nil, &fs.PathError{Op: "open", Path: path, Err: fs.ErrInvalid}
Expand Down
4 changes: 4 additions & 0 deletions pkg/tarfs/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ func checksumFromHeader(header *tar.Header) ([]byte, error) {
return checksum, nil
}

func (m *memFS) String() string {
return "tarfs"
}

func (m *memFS) WriteHeader(hdr tar.Header, tfs fs.FS, pkg *apk.Package) (bool, error) {
switch hdr.Typeflag {
case tar.TypeDir:
Expand Down