scripts: Fix helper edge cases

Propagate patch and module-list failures, normalize the script
directory, and expand the actual Mercurial subrepository name when
matching paths. Keep the existing no-optional-patches behavior
unchanged.
This commit is contained in:
Gleb Chesnokov
2026-08-21 19:58:59 +03:00
parent c93836ed2d
commit 5cc6d87b7b
3 changed files with 5 additions and 3 deletions
+2 -2
View File
@@ -28,7 +28,7 @@ script_dir="$(dirname "$0")"
if [ "${script_dir#/}" = "${script_dir}" ]; then
script_dir="$PWD/$script_dir"
fi
scriptdir="${scriptdir%/.}"
script_dir="${script_dir%/.}"
scst_dir="$(dirname "${script_dir}")"
# shellcheck source=./kernel-functions
@@ -51,5 +51,5 @@ cd "${target}" || exit $?
grep -v /in-tree/ |
while read -r p; do
echo "==== $p"
patch -p1 <"${scst_dir}/$p"
patch -p1 <"${scst_dir}/$p" || exit $?
done
+1 -1
View File
@@ -8,7 +8,7 @@ prefix_matches() {
f="$1"
shift
for s in "$@"; do
if [ "$f" = "$s" ] || [ "${f#s/}" != "$f" ]; then
if [ "$f" = "$s" ] || [ "${f#"$s/"}" != "$f" ]; then
return 0
fi
done
+2
View File
@@ -1,5 +1,7 @@
#!/bin/bash
set -o pipefail
# Parse modules.order and sign the modules found in that file.
if [ -z "$KDIR" ]; then