Gentoo Archives: gentoo-dev

From: Sam James <sam@g.o>
To: gentoo-dev@l.g.o
Cc: dist-kernel@g.o, kernel@g.o, Sam James <sam@g.o>
Subject: [gentoo-dev] [PATCH 4/8] linux-mod.eclass: improve error handling for module compression
Date: Tue, 11 Oct 2022 22:56:09
Message-Id: 20221011225444.56032-4-sam@gentoo.org
In Reply to: [gentoo-dev] [PATCH 1/8] kernel-2.eclass: decompress xz in parallel by Sam James
1 doins will 'die for us' in newer EAPIs, and add missing || dies to compressor calls.
2
3 Signed-off-by: Sam James <sam@g.o>
4 ---
5 eclass/linux-mod.eclass | 18 +++++++++---------
6 1 file changed, 9 insertions(+), 9 deletions(-)
7
8 diff --git a/eclass/linux-mod.eclass b/eclass/linux-mod.eclass
9 index e837916b881a..e4c71cdf2c15 100644
10 --- a/eclass/linux-mod.eclass
11 +++ b/eclass/linux-mod.eclass
12 @@ -716,22 +716,22 @@ linux-mod_src_install() {
13 # and similarily compress the module being built if != NONE.
14
15 if linux_chkconfig_present MODULE_COMPRESS_XZ; then
16 - xz -T$(makeopts_jobs) ${modulename}.${KV_OBJ}
17 - doins ${modulename}.${KV_OBJ}.xz || die "doins ${modulename}.${KV_OBJ}.xz failed"
18 + xz -T$(makeopts_jobs) ${modulename}.${KV_OBJ} || die "Compressing ${modulename}.${KV_OBJ} with xz failed"
19 + doins ${modulename}.${KV_OBJ}.xz
20 elif linux_chkconfig_present MODULE_COMPRESS_GZIP; then
21 if type -P pigz ; then
22 - pigz -n$(makeopts_jobs) ${modulename}.${KV_OBJ}
23 + pigz -n$(makeopts_jobs) ${modulename}.${KV_OBJ} || die "Compressing ${modulename}.${KV_OBJ} with pigz failed"
24 else
25 - gzip ${modulename}.${KV_OBJ}
26 + gzip ${modulename}.${KV_OBJ} || die "Compressing ${modulename}.${KV_OBJ} with gzip failed"
27 fi
28 - doins ${modulename}.${KV_OBJ}.gz || die "doins ${modulename}.${KV_OBJ}.gz failed"
29 + doins ${modulename}.${KV_OBJ}.gz
30 elif linux_chkconfig_present MODULE_COMPRESS_ZSTD; then
31 - zstd -T$(makeopts_jobs) ${modulename}.${KV_OBJ}
32 - doins ${modulename}.${KV_OBJ}.zst || die "doins ${modulename}.${KV_OBJ}.zst failed"
33 + zstd -T$(makeopts_jobs) ${modulename}.${KV_OBJ} || "Compressing ${modulename}.${KV_OBJ} with zstd failed"
34 + doins ${modulename}.${KV_OBJ}.zst
35 else
36 - doins ${modulename}.${KV_OBJ} || die "doins ${modulename}.${KV_OBJ} failed"
37 + doins ${modulename}.${KV_OBJ}
38 fi
39 - cd "${OLDPWD}"
40 + cd "${OLDPWD}" || die "${OLDPWD} does not exist"
41
42 generate_modulesd "${objdir}/${modulename}"
43 done
44 --
45 2.38.0