]> Git Repo - linux.git/commitdiff
merge_config.sh: exit on missing input files
authorSam Bobroff <[email protected]>
Mon, 20 Jul 2015 05:12:19 +0000 (15:12 +1000)
committerMichal Marek <[email protected]>
Thu, 20 Aug 2015 11:56:55 +0000 (13:56 +0200)
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 <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
scripts/kconfig/merge_config.sh

index ec8e20350a648ca0f47f152f9650f6fa6e421a0b..0d883b37882a145b588a45f53f3be373849e7410 100755 (executable)
@@ -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
This page took 0.056089 seconds and 4 git commands to generate.