From fcba32e9c4bc27a0cdcd1a78bbc1cf5ea799c18e Mon Sep 17 00:00:00 2001 From: Ophestra Date: Wed, 20 May 2026 02:09:12 +0900 Subject: internal/rosa/package: migrate glib Signed-off-by: Ophestra --- internal/rosa/state.go | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'internal/rosa/state.go') diff --git a/internal/rosa/state.go b/internal/rosa/state.go index 3934fe38..ed1124fb 100644 --- a/internal/rosa/state.go +++ b/internal/rosa/state.go @@ -18,6 +18,7 @@ import ( "unique" "unsafe" + "hakurei.app/check" "hakurei.app/internal/pkg" "hakurei.app/internal/rosa/azalea" ) @@ -919,21 +920,25 @@ func (ctx *evalContext) pf( } for _, pair := range files { - base, pathname, ok := strings.Cut(pair, ":") + var pathname *check.Absolute + dst, src, ok := strings.Cut(pair, ":") if !ok { - pathname, base = base, filepath.Base(base) + src, dst = dst, filepath.Base(dst) + } + if pathname, err = check.NewAbs(dst); err != nil { + pathname = AbsUsrSrc.Append(dst) } var p []byte - p, err = fs.ReadFile(ctx.b, pathname) + p, err = fs.ReadFile(ctx.b, src) if err != nil { return } attr.Paths = append(attr.Paths, pkg.Path( - AbsUsrSrc.Append(base), + pathname, false, - pkg.NewFile(base, p), + pkg.NewFile(filepath.Base(dst), p), )) } -- cgit v1.3.1