summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2009-05-07 11:09:55 -0400
committerSteven Rostedt <rostedt@goodmis.org>2009-08-18 22:15:55 -0400
commita7c02602a85a0d3f34331ff34d54de7416085985 (patch)
treef9bbb2fe066d2b97d51f176a875c5876f34dce89
parenta9024838d029ecd9a6d1389bec798b7296278d6b (diff)
downloadop-kernel-dev-a7c02602a85a0d3f34331ff34d54de7416085985.zip
op-kernel-dev-a7c02602a85a0d3f34331ff34d54de7416085985.tar.gz
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>
-rw-r--r--scripts/kconfig/Makefile30
1 files changed, 20 insertions, 10 deletions
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 12a4d9e..915a39a 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -31,21 +31,31 @@ silentoldconfig: $(obj)/conf
localmodconfig: $(obj)/streamline_config.pl $(obj)/conf
$(Q)perl $< $(Kconfig) > .tmp.config
- $(Q)cmp -s .tmp.config .config || \
- (mv -f .config .config.old.1; \
- mv -f .tmp.config .config; \
- $(obj)/conf -s $(Kconfig); \
- mv -f .config.old.1 .config.old)
+ $(Q)if [ -f .config ]; then \
+ cmp -s .tmp.config .config || \
+ (mv -f .config .config.old.1; \
+ mv -f .tmp.config .config; \
+ $(obj)/conf -s $(Kconfig); \
+ mv -f .config.old.1 .config.old) \
+ else \
+ mv -f .tmp.config .config; \
+ $(obj)/conf -s $(Kconfig); \
+ fi
$(Q)rm -f .tmp.config
localyesconfig: $(obj)/streamline_config.pl
$(Q)perl $< $(Kconfig) > .tmp.config
$(Q)sed -i s/=m/=y/ .tmp.config
- $(Q)cmp -s .tmp.config .config || \
- (mv -f .config .config.old.1; \
- mv -f .tmp.config .config; \
- $(obj)/conf -s $(Kconfig); \
- mv -f .config.old.1 .config.old)
+ $(Q)if [ -f .config ]; then \
+ cmp -s .tmp.config .config || \
+ (mv -f .config .config.old.1; \
+ mv -f .tmp.config .config; \
+ $(obj)/conf -s $(Kconfig); \
+ mv -f .config.old.1 .config.old) \
+ else \
+ mv -f .tmp.config .config; \
+ $(obj)/conf -s $(Kconfig); \
+ fi
$(Q)rm -f .tmp.config
# Create new linux.pot file
OpenPOWER on IntegriCloud