forked from rosa/hakurei
internal/rosa/package: migrate glib
Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -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),
|
||||
))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user