Files
scst/scripts/kernel/list-conditional-defines
Gleb Chesnokov 43e717c7f1 scripts: Group kernel maintenance helpers under kernel/
Move patch generation, specialization, regression, kernel selection and
module signing helpers together, with their shared shell libraries. Update
component Makefiles, CI, nightly jobs, packaging metadata, documentation
and KUnit tooling references alongside the move.

Adjust repository-root and source-inventory lookups for the deeper path.
Resolve rhel-rpm-functions relative to kernel-functions through
BASH_SOURCE, since it is also sourced by the QLogic extraction helpers.

Keep the regression runner behavior and the nightly kernel matrix intact,
including the existing checkpatch, sparse and smatch switches and policy.
2026-10-19 10:31:32 +03:00

28 lines
660 B
Awk
Executable File

#!/bin/gawk -f
# awk script that reads a patch from stdin and prints all #define statements
# that match the following patttern:
# +#ifndef <symbol>
# +#define <symbol> <text>
# +#endif
BEGIN {
previous_is_ifndef = 0
symbol = ""
}
{
is_ifndef = match($0, "^+#ifndef (.*)$", a)
if (is_ifndef)
symbol = a[1]
is_define = previous_is_ifndef && match($0, "^+#define " + symbol)
if (is_define)
define = $0
is_endif = match($0, "^+#endif$")
if (before_previous_is_ifndef && previous_is_define && is_endif)
print define
before_previous_is_ifndef = previous_is_ifndef
previous_is_ifndef = is_ifndef
previous_is_define = is_define
}