summaryrefslogtreecommitdiffstats
path: root/debian/patches/0007-prepare_build-use-return-code-77-if-skipping-due-to-.patch
blob: 2f2cf9b2edff0457f0e608cd711f300a4bf9344c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
From 3638f1119debd177b46836cdf7502d25e9888042 Mon Sep 17 00:00:00 2001
From: Andreas Beckmann <anbe@debian.org>
Date: Fri, 17 Mar 2023 10:54:49 +0100
Subject: [PATCH] prepare_build: use return code 77 if skipping due to
 BUILD_EXCLUSIVE_*

error code 9 is used at multiple locations throughout the dkms code
to indicate different unrelated errors

error code 77 has been used by GNU autotest for skipped tests and was
later adopted by other testing frameworks
---
 dkms.8.in            | 11 +++++++----
 dkms.in              |  2 +-
 dkms_common.postinst |  2 +-
 run_test.sh          |  4 ++--
 4 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/dkms.8.in b/dkms.8.in
index b003da6..b197878 100644
--- a/dkms.8.in
+++ b/dkms.8.in
@@ -654,10 +654,13 @@ missing or broken dependencies cause non-fatal warnings.
 .TP
 .B BUILD_EXCLUSIVE_KERNEL=
 This optional directive allows you to specify a regular expression which defines
-the subset of kernels which DKMS is allowed to build your module for. If the kernel
-being built for does not match against this regular expression, the dkms build
-will error out. For example, if you set it as ="^2\.4.*", your module would not be
-built for 2.6 kernels.
+the subset of kernels which DKMS is allowed to build your module for.
+If the kernel being built for does not match against this regular expression (or
+does not the satisfy the constraints of any other
+.B BUILD_EXCLUSIVE_*
+directive), the dkms build will error out with exit code 77.
+For example, if you set it as ="^2\.4.*", your module would not be built for 2.6
+or later kernels.
 .TP
 .B BUILD_EXCLUSIVE_ARCH=
 This optional directive functions very similarly to
diff --git a/dkms.in b/dkms.in
index 0383bef..128157b 100644
--- a/dkms.in
+++ b/dkms.in
@@ -1023,7 +1023,7 @@ prepare_build()
     read_conf_or_die "$kernelver" "$arch"
 
     # Error out if build_exclude is set
-    [[ $build_exclude ]] && die 9 \
+    [[ $build_exclude ]] && die 77 \
         $"The $base_dir/dkms.conf for module $module includes a BUILD_EXCLUSIVE directive which does not match this kernel/arch."\
         $"This indicates that it should not be built."
 
diff --git a/dkms_common.postinst b/dkms_common.postinst
index 3f1ddf3..a66a23f 100644
--- a/dkms_common.postinst
+++ b/dkms_common.postinst
@@ -238,7 +238,7 @@ for KERNEL in $KERNELS; do
             set +e
             dkms build -m $NAME -v $VERSION -k $KERNEL $ARCH > /dev/null
             case $? in
-            9)
+            77)
                 set -e
                 echo "Skipped."
                 continue