* [PATCH 1/1] merge_config.sh: exit on missing input files
@ 2015-07-03 5:03 Sam Bobroff
2015-07-03 11:25 ` Paul Bolle
0 siblings, 1 reply; 2+ messages in thread
From: Sam Bobroff @ 2015-07-03 5:03 UTC (permalink / raw)
To: linux-kernel
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@au1.ibm.com>
---
The current behaviour (of continuing to run with missing files) seems
like a bug to me, and I've prepared the patch with what seems to be
the safest fix: adding a test to explicitly check for file existence.
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?
This can be tested using the top level pseries_le_defconfig target and
removing arch/powerpc/configs/le.config:
$ rm arch/powerpc/configs/le.config
$ make pseries_le_defconfig
Unpatched behaviour:
Using ../arch/powerpc/configs/pseries_defconfig as base
Merging ../arch/powerpc/configs/le.config
sed: can't read ../arch/powerpc/configs/le.config: No such file or directory
cat: ../arch/powerpc/configs/le.config: No such file or directory
#
# merged configuration written to ./.config (needs make)
#
GEN ./Makefile
scripts/kconfig/conf --olddefconfig Kconfig
#
# configuration written to .config
#
Patched behaviour:
Using ../arch/powerpc/configs/pseries_defconfig as base
Merging ../arch/powerpc/configs/le.config
The merge file '../arch/powerpc/configs/le.config' does not exist. Exit.
arch/powerpc/Makefile:289: recipe for target 'pseries_le_defconfig' failed
scripts/kconfig/merge_config.sh | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/scripts/kconfig/merge_config.sh b/scripts/kconfig/merge_config.sh
index ec8e203..0d883b3 100755
--- a/scripts/kconfig/merge_config.sh
+++ b/scripts/kconfig/merge_config.sh
@@ -100,6 +100,10 @@ cat $INITFILE > $TMP_FILE
# Merge files, printing warnings on overridden values
for MERGE_FILE in $MERGE_LIST ; do
echo "Merging $MERGE_FILE"
+ if [ ! -r "$MERGE_FILE" ]; then
+ echo "The merge file '$MERGE_FILE' does not exist. Exit." >&2
+ exit 1
+ fi
CFG_LIST=$(sed -n "$SED_CONFIG_EXP" $MERGE_FILE)
for CFG in $CFG_LIST ; do
--
2.1.4
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 1/1] merge_config.sh: exit on missing input files
2015-07-03 5:03 [PATCH 1/1] merge_config.sh: exit on missing input files Sam Bobroff
@ 2015-07-03 11:25 ` Paul Bolle
0 siblings, 0 replies; 2+ messages in thread
From: Paul Bolle @ 2015-07-03 11:25 UTC (permalink / raw)
To: Sam Bobroff; +Cc: linux-kernel
On vr, 2015-07-03 at 15:03 +1000, 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@au1.ibm.com>
Could you please resend and include linux-kbuild@vger.kernel.org?
scripts/get_maintainer.pl would have told you that. (Please don't bother
including Yann Morin, as Yann has not been heard of for a long time
now.)
Thanks,
Paul Bolle
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-07-03 11:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-03 5:03 [PATCH 1/1] merge_config.sh: exit on missing input files Sam Bobroff
2015-07-03 11:25 ` Paul Bolle
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®