internal/rosa: use patch helper
All checks were successful
Test / Create distribution (push) Successful in 1m0s
Test / Sandbox (push) Successful in 2m50s
Test / Hakurei (push) Successful in 4m23s
Test / ShareFS (push) Successful in 4m21s
Test / Hpkg (push) Successful in 4m48s
Test / Sandbox (race detector) (push) Successful in 5m26s
Test / Hakurei (race detector) (push) Successful in 6m20s
Test / Flake checks (push) Successful in 1m53s

This is significantly cleaner and runs somewhat faster.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-01-28 00:58:34 +09:00
parent 660835151e
commit 823ba08dbc

View File

@@ -317,10 +317,6 @@ exec clang \
EOF
chmod +x /bin/gcc
cd /usr/src/busybox
chmod +w editors editors/awk.c
patch -p 1 < /usr/src/patches/awk-fix-literal-backslash.patch
cd "$(mktemp -d)"
make \
KBUILD_SRC=/usr/src/busybox \
@@ -345,17 +341,16 @@ cp -v busybox /work/system/bin/
ln -vs ../system/bin/hush /work/bin/sh
mkdir -vp /work/usr/bin/
ln -vs ../../system/bin/busybox /work/usr/bin/env
`, pkg.Path(AbsUsrSrc.Append("busybox"), true, pkg.NewHTTPGetTar(
&http.Client{Transport: &http.Transport{
// busybox website is really slow to respond
TLSHandshakeTimeout: 2 * time.Minute,
}},
"https://busybox.net/downloads/busybox-"+version+".tar.bz2",
mustDecode(checksum),
pkg.TarBzip2,
)), pkg.Path(
AbsUsrSrc.Append("patches", "awk-fix-literal-backslash.patch"), false,
pkg.NewFile("awk-fix-literal-backslash.patch", []byte(`diff --git a/editors/awk.c b/editors/awk.c
`, pkg.Path(AbsUsrSrc.Append("busybox"), true, t.NewPatchedSource(
"busybox", version, pkg.NewHTTPGetTar(
&http.Client{Transport: &http.Transport{
// busybox website is really slow to respond
TLSHandshakeTimeout: 2 * time.Minute,
}},
"https://busybox.net/downloads/busybox-"+version+".tar.bz2",
mustDecode(checksum),
pkg.TarBzip2,
), true, [2]string{"awk-fix-literal-backslash", `diff --git a/editors/awk.c b/editors/awk.c
index 64e752f4b..40f5ba7f7 100644
--- a/editors/awk.c
+++ b/editors/awk.c
@@ -373,7 +368,7 @@ index 64e752f4b..40f5ba7f7 100644
+ }
bslash = 0;
}
}`)),
))
}`},
)))
}
func init() { artifactsF[Busybox] = Toolchain.newBusybox }