aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/pkg
diff options
context:
space:
mode:
Diffstat (limited to 'internal/pkg')
-rw-r--r--internal/pkg/exec.go4
-rw-r--r--internal/pkg/pkg.go5
-rw-r--r--internal/pkg/tar.go4
-rw-r--r--internal/pkg/testdata/main.go18
4 files changed, 15 insertions, 16 deletions
diff --git a/internal/pkg/exec.go b/internal/pkg/exec.go
index f1385529..a78dab84 100644
--- a/internal/pkg/exec.go
+++ b/internal/pkg/exec.go
@@ -8,7 +8,7 @@ import (
"io"
"os"
"os/exec"
- "path"
+ "path/filepath"
"slices"
"strconv"
"syscall"
@@ -189,7 +189,7 @@ func NewExec(
paths ...ExecPath,
) Artifact {
if name == "" {
- name = "exec-" + path.Base(pathname.String())
+ name = "exec-" + filepath.Base(pathname.String())
}
if timeout <= 0 {
timeout = ExecTimeoutDefault
diff --git a/internal/pkg/pkg.go b/internal/pkg/pkg.go
index a8fb91ba..ea7ac815 100644
--- a/internal/pkg/pkg.go
+++ b/internal/pkg/pkg.go
@@ -16,7 +16,6 @@ import (
"iter"
"maps"
"os"
- "path"
"path/filepath"
"runtime"
"slices"
@@ -894,7 +893,7 @@ func (c *Cache) Scrub(checks int) error {
se.DanglingIdentifiers = append(se.DanglingIdentifiers, *want)
seMu.Unlock()
return false
- } else if err = Decode(got, path.Base(linkname)); err != nil {
+ } else if err = Decode(got, filepath.Base(linkname)); err != nil {
seMu.Lock()
lnp := dir.Append(linkname)
se.Errs[lnp.Handle()] = append(se.Errs[lnp.Handle()], err)
@@ -1488,7 +1487,7 @@ func (c *Cache) cure(a Artifact, curesExempt bool) (
return
}
buf := c.getIdentBuf()
- err = Decode((*Checksum)(buf[:]), path.Base(name))
+ err = Decode((*Checksum)(buf[:]), filepath.Base(name))
if err == nil {
checksum = unique.Make(Checksum(buf[:]))
}
diff --git a/internal/pkg/tar.go b/internal/pkg/tar.go
index 39f55010..32b4b362 100644
--- a/internal/pkg/tar.go
+++ b/internal/pkg/tar.go
@@ -10,7 +10,7 @@ import (
"io/fs"
"net/http"
"os"
- "path"
+ "path/filepath"
)
const (
@@ -169,7 +169,7 @@ func (a *tarArtifact) Cure(t *TContext) (err error) {
}
if typeflag >= '0' && typeflag <= '9' && typeflag != tar.TypeDir {
- if err = root.MkdirAll(path.Dir(header.Name), 0700); err != nil {
+ if err = root.MkdirAll(filepath.Dir(header.Name), 0700); err != nil {
return
}
}
diff --git a/internal/pkg/testdata/main.go b/internal/pkg/testdata/main.go
index bbe26d69..c969474d 100644
--- a/internal/pkg/testdata/main.go
+++ b/internal/pkg/testdata/main.go
@@ -7,7 +7,7 @@ import (
"log"
"net"
"os"
- "path"
+ "path/filepath"
"reflect"
"slices"
"strings"
@@ -68,7 +68,7 @@ func main() {
if got, err := os.Executable(); err != nil {
log.Fatalf("Executable: error = %v", err)
} else {
- iftPath = path.Join(path.Dir(path.Dir(got)), "ift")
+ iftPath = filepath.Join(filepath.Dir(filepath.Dir(got)), "ift")
if got != wantExec {
switch got {
@@ -161,7 +161,7 @@ func main() {
}
}
if !layers {
- if path.Base(lowerdir) != checksumEmptyDir {
+ if filepath.Base(lowerdir) != checksumEmptyDir {
log.Fatal("unexpected artifact checksum")
}
} else {
@@ -187,8 +187,8 @@ func main() {
}
if len(lowerdirs) != 2 ||
- path.Base(lowerdirs[0]) != "MGWmEfjut2QE2xPJwTsmUzpff4BN_FEnQ7T0j7gvUCCiugJQNwqt9m151fm9D1yU" ||
- path.Base(lowerdirs[1]) != "nY_CUdiaUM1OL4cPr5TS92FCJ3rCRV7Hm5oVTzAvMXwC03_QnTRfQ5PPs7mOU9fK" {
+ filepath.Base(lowerdirs[0]) != "MGWmEfjut2QE2xPJwTsmUzpff4BN_FEnQ7T0j7gvUCCiugJQNwqt9m151fm9D1yU" ||
+ filepath.Base(lowerdirs[1]) != "nY_CUdiaUM1OL4cPr5TS92FCJ3rCRV7Hm5oVTzAvMXwC03_QnTRfQ5PPs7mOU9fK" {
log.Fatalf("unexpected lowerdirs %s", strings.Join(lowerdirs, ", "))
}
}
@@ -202,12 +202,12 @@ func main() {
}
next()
- if path.Base(m.Root) != "OLBgp1GsljhM2TJ-sbHjaiH9txEUvgdDTAzHv2P24donTt6_529l-9Ua0vFImLlb" {
+ if filepath.Base(m.Root) != "OLBgp1GsljhM2TJ-sbHjaiH9txEUvgdDTAzHv2P24donTt6_529l-9Ua0vFImLlb" {
log.Fatal("unexpected file artifact checksum")
}
next()
- if path.Base(m.Root) != checksumEmptyDir {
+ if filepath.Base(m.Root) != checksumEmptyDir {
log.Fatal("unexpected artifact checksum")
}
}
@@ -226,13 +226,13 @@ func main() {
log.Fatal("unexpected work mount entry")
}
} else {
- if path.Base(m.Root) != ident || m.Target != "/work" {
+ if filepath.Base(m.Root) != ident || m.Target != "/work" {
log.Fatal("unexpected work mount entry")
}
}
next()
- if path.Base(m.Root) != ident || m.Target != "/tmp" {
+ if filepath.Base(m.Root) != ident || m.Target != "/tmp" {
log.Fatal("unexpected temp mount entry")
}