Re: [v2 08/10] scripts: Coccinelle script for namespace dependencies

From: Markus Elfring
Date: Thu Aug 15 2019 - 09:52:13 EST


> +generate_deps_for_ns() {
> + $SPATCH --very-quiet --in-place --sp-file \
> + $srctree/scripts/coccinelle/misc/add_namespace.cocci -D ns=$1 $2
> +}

* Where will the variable âsrctreeâ be set for the file âscripts/nsdepsâ?

* Would you like to support a separate build directory for desired adjustments?

* How do you think about to check error handling around such commands?


> +generate_deps() {
â
> + for source_file in $mod_source_files; do
> + sed '/MODULE_IMPORT_NS/Q' $source_file > ${source_file}.tmp
â

I suggest to assign the name for the temporary file to a variable
which should be used by subsequent commands.

Regards,
Markus