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
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:
@@ -23,7 +23,7 @@ export LLVM=1
|
|||||||
export HOSTLDFLAGS="${LDFLAGS}"
|
export HOSTLDFLAGS="${LDFLAGS}"
|
||||||
cd /usr/src/linux
|
cd /usr/src/linux
|
||||||
`+script, pkg.Path(AbsUsrSrc.Append("linux"), true, t.NewPatchedSource(
|
`+script, pkg.Path(AbsUsrSrc.Append("linux"), true, t.NewPatchedSource(
|
||||||
"kernel", pkg.NewHTTPGetTar(
|
"kernel", version, pkg.NewHTTPGetTar(
|
||||||
nil,
|
nil,
|
||||||
"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/"+
|
"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/"+
|
||||||
"snapshot/linux-"+version+".tar.gz",
|
"snapshot/linux-"+version+".tar.gz",
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ cp -r /system/include /usr/include && rm -rf /system/include
|
|||||||
}
|
}
|
||||||
|
|
||||||
return t.NewViaCMake("llvm", version, variant, t.NewPatchedSource(
|
return t.NewViaCMake("llvm", version, variant, t.NewPatchedSource(
|
||||||
"llvmorg", pkg.NewHTTPGetTar(
|
"llvmorg", version, pkg.NewHTTPGetTar(
|
||||||
nil, "https://github.com/llvm/llvm-project/archive/refs/tags/"+
|
nil, "https://github.com/llvm/llvm-project/archive/refs/tags/"+
|
||||||
"llvmorg-"+version+".tar.gz",
|
"llvmorg-"+version+".tar.gz",
|
||||||
mustDecode(checksum),
|
mustDecode(checksum),
|
||||||
|
|||||||
@@ -275,7 +275,7 @@ ln -vs ../usr/bin /work/bin
|
|||||||
// NewPatchedSource returns [pkg.Artifact] of source with patches applied. If
|
// NewPatchedSource returns [pkg.Artifact] of source with patches applied. If
|
||||||
// passthrough is true, source is returned as is for zero length patches.
|
// passthrough is true, source is returned as is for zero length patches.
|
||||||
func (t Toolchain) NewPatchedSource(
|
func (t Toolchain) NewPatchedSource(
|
||||||
name string,
|
name, version string,
|
||||||
source pkg.Artifact,
|
source pkg.Artifact,
|
||||||
passthrough bool,
|
passthrough bool,
|
||||||
patches ...[2]string,
|
patches ...[2]string,
|
||||||
@@ -293,13 +293,18 @@ func (t Toolchain) NewPatchedSource(
|
|||||||
}
|
}
|
||||||
paths[0] = pkg.Path(AbsUsrSrc.Append(name), false, source)
|
paths[0] = pkg.Path(AbsUsrSrc.Append(name), false, source)
|
||||||
|
|
||||||
aname := name + "-src"
|
aname := name + "-" + version + "-src"
|
||||||
script := `
|
script := `
|
||||||
cp -r /usr/src/` + name + `/. /work/.
|
cp -r /usr/src/` + name + `/. /work/.
|
||||||
chmod -R +w /work && cd /work
|
chmod -R +w /work && cd /work
|
||||||
`
|
`
|
||||||
if len(paths) > 1 {
|
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"
|
aname += "-patched"
|
||||||
}
|
}
|
||||||
return t.New(aname, stage3Concat(t, []pkg.Artifact{},
|
return t.New(aname, stage3Concat(t, []pkg.Artifact{},
|
||||||
|
|||||||
Reference in New Issue
Block a user