From patchwork Fri Sep 17 19:15:43 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Pop X-Patchwork-Id: 65100 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 4AE40B6EDF for ; Sat, 18 Sep 2010 05:16:01 +1000 (EST) Received: (qmail 22104 invoked by alias); 17 Sep 2010 19:15:59 -0000 Received: (qmail 22092 invoked by uid 22791); 17 Sep 2010 19:15:57 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-yw0-f47.google.com (HELO mail-yw0-f47.google.com) (209.85.213.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 17 Sep 2010 19:15:53 +0000 Received: by ywa8 with SMTP id 8so1007017ywa.20 for ; Fri, 17 Sep 2010 12:15:51 -0700 (PDT) Received: by 10.101.155.28 with SMTP id h28mr6155401ano.24.1284750951123; Fri, 17 Sep 2010 12:15:51 -0700 (PDT) Received: from napoca ([163.181.251.115]) by mx.google.com with ESMTPS id x33sm6608707ana.33.2010.09.17.12.15.49 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 17 Sep 2010 12:15:50 -0700 (PDT) Received: by napoca (sSMTP sendmail emulation); Fri, 17 Sep 2010 14:15:48 -0500 From: Sebastian Pop To: gcc-patches@gcc.gnu.org Cc: Sebastian Pop Subject: [PATCH] Do not print warning messages when there are no occurences. Date: Fri, 17 Sep 2010 14:15:43 -0500 Message-Id: <1284750943-31569-1-git-send-email-sebpop@gmail.com> X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org The patch checker used to print warning messages "Lines should not exceed 80 characters." even when there were no such lines in the patch. With this change, the warning message is printed only when there are such occurrences. Committed to trunk. 2010-07-02 Sebastian Pop * check_GNU_style.sh: Do not print warning messages when there are no occurences. --- contrib/ChangeLog | 5 +++++ contrib/check_GNU_style.sh | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/contrib/ChangeLog b/contrib/ChangeLog index 5175d51..a6b6e11 100644 --- a/contrib/ChangeLog +++ b/contrib/ChangeLog @@ -1,3 +1,8 @@ +2010-07-02 Sebastian Pop + + * check_GNU_style.sh: Do not print warning messages when there are + no occurences. + 2010-07-08 Eric Botcazou * make_sunver.pl: Remove extra whitespace in regexp. diff --git a/contrib/check_GNU_style.sh b/contrib/check_GNU_style.sh index 6396417..8fb579f 100755 --- a/contrib/check_GNU_style.sh +++ b/contrib/check_GNU_style.sh @@ -84,8 +84,11 @@ col (){ | grep -v ':+++' \ | cut -f 2 -d '+' \ | awk '{ if (length ($0) > 80) print $0 }' \ - > $tmp && printf "\n$msg\n" - cat $tmp + > $tmp + if [ -s $tmp ]; then + printf "\n$msg\n" + cat $tmp + fi } col 'Lines should not exceed 80 characters.' $*