internal/rosa: use string pair for files
All checks were successful
Test / Create distribution (push) Successful in 1m5s
Test / Sandbox (push) Successful in 2m55s
Test / ShareFS (push) Successful in 3m44s
Test / Hakurei (push) Successful in 3m53s
Test / Sandbox (race detector) (push) Successful in 5m26s
Test / Hakurei (race detector) (push) Successful in 6m28s
Test / Flake checks (push) Successful in 1m20s
All checks were successful
Test / Create distribution (push) Successful in 1m5s
Test / Sandbox (push) Successful in 2m55s
Test / ShareFS (push) Successful in 3m44s
Test / Hakurei (push) Successful in 3m53s
Test / Sandbox (race detector) (push) Successful in 5m26s
Test / Hakurei (race detector) (push) Successful in 6m28s
Test / Flake checks (push) Successful in 1m20s
This is a much cleaner representation than the separator syntax. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -91,7 +91,7 @@ type TypeError struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (e TypeError) Error() string {
|
func (e TypeError) Error() string {
|
||||||
return "expected " + e.Asserted.String() + ", got " + e.Concrete.String()
|
return fmt.Sprintf("expected %s, got %s", e.Asserted, e.Concrete)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e TypeError) Is(err error) bool {
|
func (e TypeError) Is(err error) bool {
|
||||||
|
|||||||
@@ -10,10 +10,10 @@ package glib {
|
|||||||
checksum = "Rkszn6W4RHjyspyqfXdVAVawdwDJCuS0Zu0f7qot7tbJhnw2fUDoUUJB40m-1MCX";
|
checksum = "Rkszn6W4RHjyspyqfXdVAVawdwDJCuS0Zu0f7qot7tbJhnw2fUDoUUJB40m-1MCX";
|
||||||
};
|
};
|
||||||
|
|
||||||
files = [
|
files = {
|
||||||
"/etc/machine-id:stub-machine-id-fhs",
|
"/etc/machine-id": "stub-machine-id-fhs";
|
||||||
"/system/var/lib/dbus/machine-id:stub-machine-id",
|
"/system/var/lib/dbus/machine-id": "stub-machine-id";
|
||||||
];
|
};
|
||||||
|
|
||||||
exec = meson {
|
exec = meson {
|
||||||
setup = {
|
setup = {
|
||||||
|
|||||||
@@ -17,10 +17,10 @@ package kernel-headers {
|
|||||||
|
|
||||||
source = kernel-source;
|
source = kernel-source;
|
||||||
|
|
||||||
files = [
|
files = {
|
||||||
// updated manually for API changes
|
// updated manually for API changes
|
||||||
"version.h",
|
"version.h";
|
||||||
];
|
};
|
||||||
toyboxEarly = true;
|
toyboxEarly = true;
|
||||||
|
|
||||||
exec = make {
|
exec = make {
|
||||||
@@ -61,16 +61,16 @@ package kernel {
|
|||||||
"f54a91f5337cd918eb86cf600320d25b6cfd8209.patch",
|
"f54a91f5337cd918eb86cf600320d25b6cfd8209.patch",
|
||||||
"6ce6fbfddc5b127e4f57c3b5bfdcf40239a4fc2f.patch",
|
"6ce6fbfddc5b127e4f57c3b5bfdcf40239a4fc2f.patch",
|
||||||
];
|
];
|
||||||
files = [
|
files = {
|
||||||
arch {
|
".config": arch {
|
||||||
amd64 = ".config:kernel_amd64.config";
|
amd64 = "kernel_amd64.config";
|
||||||
arm64 = ".config:kernel_arm64.config";
|
arm64 = "kernel_arm64.config";
|
||||||
riscv64 = ".config:kernel_riscv64.config";
|
riscv64 = "kernel_riscv64.config";
|
||||||
},
|
};
|
||||||
|
|
||||||
".installkernel:installkernel",
|
".installkernel": "installkernel";
|
||||||
".depmod:depmod",
|
".depmod": "depmod";
|
||||||
];
|
};
|
||||||
|
|
||||||
env = [
|
env = [
|
||||||
"PATH=/system/sbin",
|
"PATH=/system/sbin",
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ package libarchive {
|
|||||||
checksum = "CUJK4MDQmZmATClgQBH2Wt-7Ts4iiSUlg1J_TVb6-5IK3rVUgVLIMc5k-bnWB9w3";
|
checksum = "CUJK4MDQmZmATClgQBH2Wt-7Ts4iiSUlg1J_TVb6-5IK3rVUgVLIMc5k-bnWB9w3";
|
||||||
};
|
};
|
||||||
|
|
||||||
files = [ "CTestCustom.cmake" ];
|
files = { "CTestCustom.cmake"; };
|
||||||
|
|
||||||
writable = true;
|
writable = true;
|
||||||
early = "\ninstall -Dv /usr/src/CTestCustom.cmake /cure/\n";
|
early = "\ninstall -Dv /usr/src/CTestCustom.cmake /cure/\n";
|
||||||
|
|||||||
@@ -899,7 +899,7 @@ func (ctx *evalContext) pf(
|
|||||||
var (
|
var (
|
||||||
attr PackageAttr
|
attr PackageAttr
|
||||||
patches []string
|
patches []string
|
||||||
files []string
|
files []KV
|
||||||
excl bool
|
excl bool
|
||||||
early bool
|
early bool
|
||||||
|
|
||||||
@@ -965,16 +965,17 @@ func (ctx *evalContext) pf(
|
|||||||
|
|
||||||
for _, pair := range files {
|
for _, pair := range files {
|
||||||
var pathname *check.Absolute
|
var pathname *check.Absolute
|
||||||
dst, src, ok := strings.Cut(pair, ":")
|
if pathname, err = check.NewAbs(pair[0]); err != nil {
|
||||||
if !ok {
|
pathname = AbsUsrSrc.Append(pair[0])
|
||||||
src, dst = dst, filepath.Base(dst)
|
err = nil
|
||||||
}
|
}
|
||||||
if pathname, err = check.NewAbs(dst); err != nil {
|
|
||||||
pathname = AbsUsrSrc.Append(dst)
|
if pair[1] == "" {
|
||||||
|
pair[1] = pair[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
var p []byte
|
var p []byte
|
||||||
p, err = fs.ReadFile(ctx.b, src)
|
p, err = fs.ReadFile(ctx.b, pair[1])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -982,8 +983,8 @@ func (ctx *evalContext) pf(
|
|||||||
attr.Paths = append(attr.Paths, pkg.Path(
|
attr.Paths = append(attr.Paths, pkg.Path(
|
||||||
pathname,
|
pathname,
|
||||||
false,
|
false,
|
||||||
pkg.NewFile(filepath.Base(dst), p),
|
pkg.NewFile(filepath.Base(pair[0]), p)),
|
||||||
))
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
if excl {
|
if excl {
|
||||||
|
|||||||
Reference in New Issue
Block a user