aboutsummaryrefslogtreecommitdiffhomepage
path: root/pkg
diff options
context:
space:
mode:
Diffstat (limited to 'pkg')
-rw-r--r--pkg/archive.go8
-rw-r--r--pkg/pkg.go3
2 files changed, 7 insertions, 4 deletions
diff --git a/pkg/archive.go b/pkg/archive.go
index 532c0df9..ba7c61b9 100644
--- a/pkg/archive.go
+++ b/pkg/archive.go
@@ -314,10 +314,10 @@ func (archiveArtifact) IsExclusive() bool { return false }
// Revision satisfies [RevisionArtifact] for status behaviour.
func (archiveArtifact) Revision() uint64 { return 0 }
-// Unpack reads an archive stream from r and unpacks its contents to dir. If
+// Extract reads an archive stream from r and writes its contents to dir. If
// writeStatus is non-nil, it is called with a user-facing message after
-// each successfully unpacked entry.
-func Unpack(
+// each successfully extracted entry.
+func Extract(
r io.Reader,
dir string,
writeStatus func(s string) error,
@@ -444,7 +444,7 @@ func (a archiveArtifact) Cure(t *TContext) (err error) {
}
msg := t.GetMessage()
- err = Unpack(r, t.GetWorkDir().String(), func(s string) (err error) {
+ err = Extract(r, t.GetWorkDir().String(), func(s string) (err error) {
msg.Verbose(s)
if _, err = io.WriteString(status, s); err != nil {
return
diff --git a/pkg/pkg.go b/pkg/pkg.go
index e3d32028..c2fe42fe 100644
--- a/pkg/pkg.go
+++ b/pkg/pkg.go
@@ -2933,6 +2933,9 @@ func Open(
return &c, nil
}
+// Path returns the pathname of the directory holding [Cache] state.
+func (c *Cache) Path() *check.Absolute { return c.base }
+
// Collected is returned by [Collect.Cure] to indicate a successful collection.
type Collected struct{}