diff options
author | Steven Rostedt <srostedt@redhat.com> | 2009-05-07 11:09:55 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2009-08-18 22:15:55 -0400 |
commit | a7c02602a85a0d3f34331ff34d54de7416085985 (patch) | |
tree | f9bbb2fe066d2b97d51f176a875c5876f34dce89 /scripts/kconfig | |
parent | a9024838d029ecd9a6d1389bec798b7296278d6b (diff) |
kconfig: test if a .config already exists
If one were to run localmodconfig or localyesconfig without having
a .config already in the file, then the end of the process would give
a warning when it tries to move the old .config to .config.old.
This patch adds a test to check if .config exists and avoid the moves
if it does not.
[ Impact: remove warning after make localmodconfig ]
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'scripts/kconfig')
-rw-r--r-- | scripts/kconfig/Makefile | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index 12a4d9e2cadb..915a39a03298 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile | |||
@@ -31,21 +31,31 @@ silentoldconfig: $(obj)/conf | |||
31 | 31 | ||
32 | localmodconfig: $(obj)/streamline_config.pl $(obj)/conf | 32 | localmodconfig: $(obj)/streamline_config.pl $(obj)/conf |
33 | $(Q)perl $< $(Kconfig) > .tmp.config | 33 | $(Q)perl $< $(Kconfig) > .tmp.config |
34 | $(Q)cmp -s .tmp.config .config || \ | 34 | $(Q)if [ -f .config ]; then \ |
35 | (mv -f .config .config.old.1; \ | 35 | cmp -s .tmp.config .config || \ |
36 | mv -f .tmp.config .config; \ | 36 | (mv -f .config .config.old.1; \ |
37 | $(obj)/conf -s $(Kconfig); \ | 37 | mv -f .tmp.config .config; \ |
38 | mv -f .config.old.1 .config.old) | 38 | $(obj)/conf -s $(Kconfig); \ |
39 | mv -f .config.old.1 .config.old) \ | ||
40 | else \ | ||
41 | mv -f .tmp.config .config; \ | ||
42 | $(obj)/conf -s $(Kconfig); \ | ||
43 | fi | ||
39 | $(Q)rm -f .tmp.config | 44 | $(Q)rm -f .tmp.config |
40 | 45 | ||
41 | localyesconfig: $(obj)/streamline_config.pl | 46 | localyesconfig: $(obj)/streamline_config.pl |
42 | $(Q)perl $< $(Kconfig) > .tmp.config | 47 | $(Q)perl $< $(Kconfig) > .tmp.config |
43 | $(Q)sed -i s/=m/=y/ .tmp.config | 48 | $(Q)sed -i s/=m/=y/ .tmp.config |
44 | $(Q)cmp -s .tmp.config .config || \ | 49 | $(Q)if [ -f .config ]; then \ |
45 | (mv -f .config .config.old.1; \ | 50 | cmp -s .tmp.config .config || \ |
46 | mv -f .tmp.config .config; \ | 51 | (mv -f .config .config.old.1; \ |
47 | $(obj)/conf -s $(Kconfig); \ | 52 | mv -f .tmp.config .config; \ |
48 | mv -f .config.old.1 .config.old) | 53 | $(obj)/conf -s $(Kconfig); \ |
54 | mv -f .config.old.1 .config.old) \ | ||
55 | else \ | ||
56 | mv -f .tmp.config .config; \ | ||
57 | $(obj)/conf -s $(Kconfig); \ | ||
58 | fi | ||
49 | $(Q)rm -f .tmp.config | 59 | $(Q)rm -f .tmp.config |
50 | 60 | ||
51 | # Create new linux.pot file | 61 | # Create new linux.pot file |