merge_config.sh: Use the first file as the initial config
authorJosh Boyer <jwboyer@redhat.com>
Wed, 1 Feb 2012 17:01:58 +0000 (12:01 -0500)
committerMichal Marek <mmarek@suse.cz>
Sat, 24 Mar 2012 22:25:40 +0000 (23:25 +0100)
Take the first config fragment and use it verbatim as the initial config
set.  This avoids running the verification loop for the first file, as
nothing has actually been merged at this point.  This significantly
increases performance for large config fragments.

Signed-off-by: Josh Boyer <jwboyer@redhat.com>
Acked-by: John Stultz <john.stultz@linaro.org>
Acked-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
scripts/kconfig/merge_config.sh

index ceadf0e150cfe6cf4bc3d087b79b52df70f45a2e..23d738a1acda2f655aea6d06abb280240a4cbba9 100644 (file)
@@ -58,12 +58,16 @@ while true; do
        esac
 done
 
-
+INITFILE=$1
+shift;
 
 MERGE_LIST=$*
 SED_CONFIG_EXP="s/^\(# \)\{0,1\}\(CONFIG_[a-zA-Z0-9_]*\)[= ].*/\2/p"
 TMP_FILE=$(mktemp ./.tmp.config.XXXXXXXXXX)
 
+echo "Using $INITFILE as base"
+cat $INITFILE > $TMP_FILE
+
 # Merge files, printing warnings on overrided values
 for MERGE_FILE in $MERGE_LIST ; do
        echo "Merging $MERGE_FILE"