Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Marek <mmarek@suse.cz>2011-07-22 14:41:55 +0200
committerMichal Marek <mmarek@suse.cz>2011-07-22 21:26:41 +0200
commitaecea14d07e72a88b2926bed0f5ca276a4988b66 (patch)
treefb5aa2e6b75e841f5d5ede5e58c484bd62777d01
parentd472b2a58dd95f6444460fd4cf393bc58f9aafdc (diff)
scripts/run_oldconfig.sh: Reuse answers to new config options
After a configuration is processed, the script will print the new config options and ask if they should be applied to all other configs, all configs for the same architecture or all configs for the same flavor. Signed-off-by: Michal Marek <mmarek@suse.cz>
-rwxr-xr-xscripts/run_oldconfig.sh64
1 files changed, 63 insertions, 1 deletions
diff --git a/scripts/run_oldconfig.sh b/scripts/run_oldconfig.sh
index c601de7781..871a31887b 100755
--- a/scripts/run_oldconfig.sh
+++ b/scripts/run_oldconfig.sh
@@ -240,7 +240,60 @@ ${prefix}scripts/guards $EXTRA_SYMBOLS < ${prefix}series.conf \
EXTRA_SYMBOLS="$(echo $EXTRA_SYMBOLS | sed -e 's# *[Rr][Tt] *##g')"
-last_arch=
+mkdir $TMPDIR/reuse
+
+ask_reuse_config()
+{
+ local old=$1 new=$2
+
+ # if the user either asked to never reuse the config or if this config
+ # already reused something, do nothing
+ for f in $TMPDIR/reuse/{never,all,$cpu_arch-all,all-$flavor}; do
+ if test -e "$f"; then
+ return
+ fi
+ done
+ diff $old $new | awk >$TMPDIR/reuse/diff '
+ /< .*CONFIG_/ { x[substr($0, 3)]--; }
+ /> .*CONFIG_/ { x[substr($0, 3)]++; }
+ END {
+ for (l in x)
+ if (x[l] > 0)
+ print l;
+ }'
+
+ if test ! -s $TMPDIR/reuse/diff; then
+ return
+ fi
+ while :; do
+ echo
+ cat $TMPDIR/reuse/diff | sed 's/^/ /'
+ echo
+ echo "Use these settings for other configurations?"
+ read -p "[Y]es/for [A]rch $cpu_arch/for [F]lavor $flavor/[N]o/[E]dit/ne[V]er "
+ case "$REPLY" in
+ [Yy] | "")
+ mv $TMPDIR/reuse/diff $TMPDIR/reuse/all
+ break ;;
+ [Aa])
+ mv $TMPDIR/reuse/diff $TMPDIR/reuse/$cpu_arch-all
+ break ;;
+ [Ff])
+ mv $TMPDIR/reuse/diff $TMPDIR/reuse/all-$flavor
+ break ;;
+ [Ee])
+ ${VISUAL:-${EDITOR:-vi}} $TMPDIR/reuse/diff
+ ;;
+ [Nn])
+ rm $TMPDIR/reuse/diff
+ break ;;
+ [Vv])
+ rm $TMPDIR/reuse/diff
+ touch $TMPDIR/reuse/never
+ break ;;
+ esac
+ done
+}
for config in $config_files; do
cpu_arch=${config%/*}
@@ -288,6 +341,12 @@ for config in $config_files; do
fi \
| bash ${prefix}rpm/config-subst CONFIG_SUSE_KERNEL y \
> .config
+ for f in $TMPDIR/reuse/{all,$cpu_arch-all,all-$flavor}; do
+ if test -e "$f"; then
+ echo "Reusing choice for ${f##*/}"
+ cat "$f" >>.config
+ fi
+ done
export KCONFIG_NOTIMESTAMP=1
case "$mode" in
menuconfig)
@@ -296,17 +355,20 @@ for config in $config_files; do
yes)
_region_msg_ "working on $config"
yes '' | make $MAKE_ARGS oldconfig
+ touch $TMPDIR/reuse/never
;;
allmodconfig)
_region_msg_ "working on $config"
cp .config config-old
KCONFIG_ALLCONFIG=config-old make $MAKE_ARGS allmodconfig
rm config-old
+ touch $TMPDIR/reuse/never
;;
*)
_region_msg_ "working on $config"
make $MAKE_ARGS oldconfig
esac
+ ask_reuse_config $config .config
if ! diff -U0 $config .config; then
sed '/^# Linux kernel version:/d' < .config > $config
fi