Skip to content

Commit ba10414

Browse files
committed
rust_is_available: exit showing the documentation
Signed-off-by: Alice Ferrazzi <[email protected]>
1 parent bd12347 commit ba10414

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

Diff for: scripts/rust_is_available.sh

+13-6
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,21 @@ get_canonical_version()
2121
echo $((100000 * $1 + 100 * $2 + $3))
2222
}
2323

24+
_show_documentation_on_exit() {
25+
echo >&2 "*** Please refer to the following documentation:"
26+
echo >&2 "*** https://docs.kernel.org/rust/quick-start.html"
27+
echo >&2 "***"
28+
exit 1
29+
}
30+
2431
# Check that the Rust compiler exists.
2532
if ! command -v "$RUSTC" >/dev/null; then
2633
if [ "$1" = -v ]; then
2734
echo >&2 "***"
2835
echo >&2 "*** Rust compiler '$RUSTC' could not be found."
2936
echo >&2 "***"
3037
fi
31-
exit 1
38+
_show_documentation_on_exit
3239
fi
3340

3441
# Check that the Rust bindings generator exists.
@@ -38,7 +45,7 @@ if ! command -v "$BINDGEN" >/dev/null; then
3845
echo >&2 "*** Rust bindings generator '$BINDGEN' could not be found."
3946
echo >&2 "***"
4047
fi
41-
exit 1
48+
_show_documentation_on_exit
4249
fi
4350

4451
# Check that the Rust compiler version is suitable.
@@ -60,7 +67,7 @@ if [ "$rust_compiler_cversion" -lt "$rust_compiler_min_cversion" ]; then
6067
echo >&2 "*** Minimum version: $rust_compiler_min_version"
6168
echo >&2 "***"
6269
fi
63-
exit 1
70+
_show_documentation_on_exit
6471
fi
6572
if [ "$1" = -v ] && [ "$rust_compiler_cversion" -gt "$rust_compiler_min_cversion" ]; then
6673
echo >&2 "***"
@@ -89,7 +96,7 @@ if [ "$rust_bindings_generator_cversion" -lt "$rust_bindings_generator_min_cvers
8996
echo >&2 "*** Minimum version: $rust_bindings_generator_min_version"
9097
echo >&2 "***"
9198
fi
92-
exit 1
99+
_show_documentation_on_exit
93100
fi
94101
if [ "$1" = -v ] && [ "$rust_bindings_generator_cversion" -gt "$rust_bindings_generator_min_cversion" ]; then
95102
echo >&2 "***"
@@ -117,7 +124,7 @@ if [ "$bindgen_libclang_cversion" -lt "$bindgen_libclang_min_cversion" ]; then
117124
echo >&2 "*** Minimum version: $bindgen_libclang_min_version"
118125
echo >&2 "***"
119126
fi
120-
exit 1
127+
_show_documentation_on_exit
121128
fi
122129

123130
# If the C compiler is Clang, then we can also check whether its version
@@ -156,5 +163,5 @@ if [ ! -e "$rustc_src_core" ]; then
156163
echo >&2 "*** at '$rustc_src_core'."
157164
echo >&2 "***"
158165
fi
159-
exit 1
166+
_show_documentation_on_exit
160167
fi

0 commit comments

Comments
 (0)