From patchwork Tue Aug 13 21:29:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Pagano X-Patchwork-Id: 2844102 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B1BEB9F239 for ; Wed, 14 Aug 2013 01:29:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6142820420 for ; Wed, 14 Aug 2013 01:29:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 504D2203E5 for ; Wed, 14 Aug 2013 01:29:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758398Ab3HNB3i (ORCPT ); Tue, 13 Aug 2013 21:29:38 -0400 Received: from 216.155.138.14.choopa.net ([216.155.138.14]:52702 "EHLO hopi.mpagano.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1758205Ab3HNB3i (ORCPT ); Tue, 13 Aug 2013 21:29:38 -0400 Received: from localhost (localhost [127.0.0.1]) by hopi.mpagano.com (Postfix) with ESMTP id 8D6F41D001F for ; Tue, 13 Aug 2013 21:29:08 -0400 (EDT) X-Virus-Scanned: amavisd-new at example.com Received: from hopi.mpagano.com ([127.0.0.1]) by localhost (mpagano.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RFKNJIppoNJ8 for ; Tue, 13 Aug 2013 21:29:05 -0400 (EDT) Received: from comanche.localnet (pool-96-234-78-247.nwrknj.fios.verizon.net [96.234.78.247]) by hopi.mpagano.com (Postfix) with ESMTPA id 1055A1D0010 for ; Tue, 13 Aug 2013 21:29:05 -0400 (EDT) From: Mike Pagano To: linux-kbuild@vger.kernel.org Subject: [PATCH] kconfig: Gracefully exit if the default config files are not present Date: Tue, 13 Aug 2013 17:29:34 -0400 Message-ID: <6523722.tcSzR9xRoc@comanche> User-Agent: KMail/4.10.5 (Linux/3.10.5-gentoo; KDE/4.10.5; x86_64; ; ) MIME-Version: 1.0 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00, DATE_IN_PAST_03_06, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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 = []