[PATCH] kconfig: Gracefully exit if the default config files are not present

Mike Pagano
2013-08-14T01:29:38Z

Gracefully exit if the default config files are not present. (.config and
.config.old)

Diffconfig is a utility script for comparing kernel configuration files.

Signed-off-by: Mike Pagano <mpagano@gentoo.org>
---
scripts/diffconfig | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/scripts/diffconfig b/scripts/diffconfig
index b91f3e3..33c696f 100755
--- a/scripts/diffconfig
+++ b/scripts/diffconfig
@@ -94,8 +94,12 @@ def main():
configa_filename = sys.argv[1]
configb_filename = sys.argv[2]

- a = readconfig(file(configa_filename))
- b = readconfig(file(configb_filename))
+ try:
+ a = readconfig(file(configa_filename))
+ b = readconfig(file(configb_filename))
+ except IOError,(errno, strerror):
+ print "I/O error(%s: %s)\n" % (errno, strerror)
+ usage()

# print items in a but not b (accumulate, sort and print)
old = []
--
1.8.1.5