From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4478 invoked by alias); 8 Nov 2011 15:29:51 -0000 Received: (qmail 4468 invoked by uid 22791); 8 Nov 2011 15:29:50 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-gy0-f175.google.com (HELO mail-gy0-f175.google.com) (209.85.160.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 08 Nov 2011 15:29:36 +0000 Received: by gyh4 with SMTP id 4so699998gyh.20 for ; Tue, 08 Nov 2011 07:29:35 -0800 (PST) MIME-Version: 1.0 Received: by 10.236.73.166 with SMTP id v26mr44096046yhd.100.1320766175399; Tue, 08 Nov 2011 07:29:35 -0800 (PST) Received: by 10.150.137.5 with HTTP; Tue, 8 Nov 2011 07:29:35 -0800 (PST) In-Reply-To: <2F57A6CB-2AAE-4F38-94A9-64D87E554403@comcast.net> References: <4CD2433B-1994-4834-A595-131242428431@comcast.net> <2F57A6CB-2AAE-4F38-94A9-64D87E554403@comcast.net> Date: Tue, 08 Nov 2011 16:11:00 -0000 Message-ID: Subject: Re: PATCH: Add capability to contrib/compare_tests to handle directories From: Quentin Neill To: Mike Stump Cc: gcc-patches@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-11/txt/msg01197.txt.bz2 On Sat, Nov 5, 2011 at 4:26 PM, Mike Stump wrote: > On Nov 4, 2011, at 8:23 PM, Quentin Neill wrote: >> This patch concatenates the common .sum files before comparing. >> >> Okay to commit? > > Ok, thanks for the contribution. > FYI I see my patch was missing these two fixes: 1. fix missing sum1 and sum2 temp variables 2. handle trailing slashes in dir args Okay to commit? Should I commit such a patch as trivial? -- Quentin Index: compare_tests =================================================================== --- compare_tests (revision 181166) +++ compare_tests (working copy) @@ -43,7 +43,9 @@ lst2=/tmp/$tool-lst2.$$ lst3=/tmp/$tool-lst3.$$ lst4=/tmp/$tool-lst4.$$ lst5=/tmp/$tool-lst5.$$ -tmps="$tmp1 $tmp2 $now_s $before_s $lst1 $lst2 $lst3 $lst4 $lst5" +sum1=/tmp/$tool-sum1.$$ +sum2=/tmp/$tool-sum2.$$ +tmps="$tmp1 $tmp2 $now_s $before_s $lst1 $lst2 $lst3 $lst4 $lst5 $sum1 $sum2" [ "$1" = "-strict" ] && strict=$1 && shift [ "$1" = "-?" ] && usage @@ -60,8 +62,8 @@ if [ -d "$1" -a -d "$2" ] ; then echo "## Dir2=$2: `cat $lst2 | wc -l` sum files" echo # remove leading directory components to compare - sed -e "s|^$1/||" $lst1 | sort >$lst3 - sed -e "s|^$2/||" $lst2 | sort >$lst4 + sed -e "s|^$1[/]*||" $lst1 | sort >$lst3 + sed -e "s|^$2[/]*||" $lst2 | sort >$lst4 comm -23 $lst3 $lst4 >$lst5 if [ -s $lst5 ] ; then echo "# Extra sum files in Dir1=$1"