internal/rosa: patch ignore whitespace
All checks were successful
Test / Create distribution (push) Successful in 51s
Test / Sandbox (push) Successful in 2m47s
Test / Hakurei (push) Successful in 4m39s
Test / ShareFS (push) Successful in 4m39s
Test / Hpkg (push) Successful in 5m16s
Test / Hakurei (race detector) (push) Successful in 6m25s
Test / Sandbox (race detector) (push) Successful in 3m14s
Test / Flake checks (push) Successful in 1m49s

This makes it work better with patches emitted by git.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-01-26 21:56:09 +09:00
parent 4356f978aa
commit 76c657177d
3 changed files with 10 additions and 5 deletions

View File

@@ -275,7 +275,7 @@ ln -vs ../usr/bin /work/bin
// NewPatchedSource returns [pkg.Artifact] of source with patches applied. If
// passthrough is true, source is returned as is for zero length patches.
func (t Toolchain) NewPatchedSource(
name string,
name, version string,
source pkg.Artifact,
passthrough bool,
patches ...[2]string,
@@ -293,13 +293,18 @@ func (t Toolchain) NewPatchedSource(
}
paths[0] = pkg.Path(AbsUsrSrc.Append(name), false, source)
aname := name + "-src"
aname := name + "-" + version + "-src"
script := `
cp -r /usr/src/` + name + `/. /work/.
chmod -R +w /work && cd /work
`
if len(paths) > 1 {
script += `cat /usr/src/` + name + `-patches/* | patch -p 1`
script += `
cat /usr/src/` + name + `-patches/* | \
patch \
-p 1 \
--ignore-whitespace
`
aname += "-patched"
}
return t.New(aname, stage3Concat(t, []pkg.Artifact{},