Re: [PATCH v2 1/1] merge_config.sh: exit on missing input files

From: Michal Marek
Date: Thu Aug 20 2015 - 08:06:37 EST


On 2015-07-20 07:12, Sam Bobroff wrote:
> Add a check for the existence of input files and exit (with failure)
> if they are missing.
>
> Without this additional check, missing files produce error messages
> but still result in an output file being generated and a successful
> exit code.
>
> Signed-off-by: Sam Bobroff <sam.bobroff@xxxxxxxxxxx>

Thanks, applied to kbuild.git#kconfig.


> Additionally, it seems like it might be a good idea (either with or
> without this patch) to add "set -e" to the script because this patch
> only handles missing files, not other errors (which will currently be
> ignored and return a successful exit code). Should I add this to the
> patch?

I'd prefer proper error handling over set -e. set -e usually bites you
when you expect it the least, e.g. inside the loop at the end of the script:

REQUESTED_VAL=$(grep -w -e "$CFG" $TMP_FILE)
ACTUAL_VAL=$(grep -w -e "$CFG" $OUTPUT/.config)

The second grep call can return 1, but in this case we want to report
the difference.

Michal
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/