From 5cc6d87b7bf916d5bef58f22b6e59bd5227acaec Mon Sep 17 00:00:00 2001 From: Gleb Chesnokov Date: Fri, 21 Aug 2026 13:39:13 +0300 Subject: [PATCH] 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. --- scripts/generate-patched-kernel | 4 ++-- scripts/list-non-source-files | 2 +- scripts/sign-modules | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/generate-patched-kernel b/scripts/generate-patched-kernel index 173c6519a..2f1b2fcff 100755 --- a/scripts/generate-patched-kernel +++ b/scripts/generate-patched-kernel @@ -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 diff --git a/scripts/list-non-source-files b/scripts/list-non-source-files index d6568863b..a3b16e953 100755 --- a/scripts/list-non-source-files +++ b/scripts/list-non-source-files @@ -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 diff --git a/scripts/sign-modules b/scripts/sign-modules index 4741b5501..03cb23565 100755 --- a/scripts/sign-modules +++ b/scripts/sign-modules @@ -1,5 +1,7 @@ #!/bin/bash +set -o pipefail + # Parse modules.order and sign the modules found in that file. if [ -z "$KDIR" ]; then