OSDN Git Service

2012-02-15 Quentin Neill <quentin.neill@amd.com>
authorqneill <qneill@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 15 Feb 2012 20:58:40 +0000 (20:58 +0000)
committerqneill <qneill@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 15 Feb 2012 20:58:40 +0000 (20:58 +0000)
* compare_tests: Fix trailing paths in dir arguments.
Handle sum1/sum2 temp files with others.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@184284 138bc75d-0d04-0410-961f-82ee72b054a4

contrib/ChangeLog
contrib/compare_tests

index 789f345..7f95288 100644 (file)
@@ -1,3 +1,8 @@
+2012-02-15   Quentin Neill  <quentin.neill@amd.com>
+
+       * compare_tests: Fix trailing paths in dir arguments.
+       Handle sum1/sum2 temp files with others.
+
 2012-02-14  Walter Lee  <walt@tilera.com>
 
        * config-list.mk (LIST): Add tilegx-linux-gnu and
index eb17b32..2fc6e05 100755 (executable)
@@ -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"
@@ -83,14 +85,11 @@ if [ -d "$1" -a -d "$2" ] ; then
                exit $exit_status
        fi
        cmnsums=`cat $lst5 | wc -l`
-       sum1="/tmp/$tool-sum-1"
-       sum2="/tmp/$tool-sum-2"
        echo "# Comparing $cmnsums common sum files"
        ( for fname in `cat $lst5`; do cat $1/$fname; done ) >$sum1
        ( for fname in `cat $lst5`; do cat $2/$fname; done ) >$sum2
        echo "## ${CONFIG_SHELL-/bin/sh} $0 $strict $sum1 $sum2"
        ${CONFIG_SHELL-/bin/sh} $0 $strict $sum1 $sum2
-       rm -f $sum1 $sum2
        ret=$?
        if [ $ret -ne 0 ]; then
                exit_status=`expr $exit_status + 1`