diff --git a/Tools/portbuild/scripts/bothlogs b/Tools/portbuild/scripts/bothlogs
index 55121bce8505..da767fe154b1 100755
--- a/Tools/portbuild/scripts/bothlogs
+++ b/Tools/portbuild/scripts/bothlogs
@@ -1,62 +1,51 @@
#!/bin/sh
-# prints out logs that are in all directories
+# prints out logs that are in dir1 but not in dir2
-if [ $# -lt 2 ]; then
- echo "usage: $0 dir1 dir2 [dir3...]"
+if [ $# -ne 3 ]; then
+ echo "usage: $0 arch dir1 dir2"
exit 1
fi
here=$(pwd)
-dir1=$1
+arch=$1
+dir1=$2
+dir2=$3
+fdir1=$here/${arch}-$dir1
+fdir2=$here/${arch}-$dir2
+ldir2=$(cd $fdir2; pwd | sed -e 's/e\./a./')
-concat="$(echo $*)"
-plus="$(echo $* | sed -e 's/ /+/g')"
+plus="$(echo $2 $3 | sed -e 's/ /+/g')"
-of=$here/$plus.html
+of=$here/$arch-$plus.html
-echo "
Logs that are in all of \"$concat\"" >$of
-echo "Logs that are in all of \"$concat\"
" >>$of
+echo "Logs that are in both $dir1 and $dir2" >$of
+echo "Logs that are in both $dir1 and $dir2
" >>$of
echo "" >>$of
-cd $here/$1
+cd $fdir1
+logs=$(find . -name \*.log -o -name \*.log.bz2 | sed -e 's/\.log\.bz2/\.log/g')
+nlogs=$(echo $logs | wc -w)
-logs="$(echo *.log)"
-
-if [ "x$logs" = "x*.log" ]; then
- echo "No errors" >>$of
+if [ $nlogs -eq 0 ]; then
+ echo "No errors" >>$of;
else
- shift
- while [ $# -gt 0 ]; do
- num=0
- newlogs=""
- cd $here/$1
- for log in *.log; do
- if echo $logs | grep -Fwq $log; then
- newlogs="$newlogs $log"
- num=$(($num + 1))
- fi
- done
- logs=$newlogs
- shift
+ num=0
+ echo "" >>$of
+ echo "Log |
" >>$of
+ for i in $logs; do
+ if [ -f ${fdir2}/${i}.bz2 -o -f ${fdir2}/${i} ]; then
+ fname1=$(basename $i .bz2)
+ fname=$(basename $fname1 .log)
+ echo -n "" >> $of
+ echo -n "$fname | " >>$of
+ echo -n "$fname | " >>$of
+ echo "
" >>$of
+ num=$(($num + 1))
+ fi
done
- if [ $num = 0 ]; then
- echo "No errors" >>$of
- else
- echo "
" >> $of
- echo "$num errors
" >> $of
- fi
+ echo "
" >> $of
+ echo "$num errors
" >> $of
fi
echo "
" >> $of
diff --git a/Tools/portbuild/scripts/comparelogs b/Tools/portbuild/scripts/comparelogs
index ba456e41a24a..f86fed98ce31 100755
--- a/Tools/portbuild/scripts/comparelogs
+++ b/Tools/portbuild/scripts/comparelogs
@@ -2,44 +2,48 @@
# prints out logs that are in dir1 but not in dir2
-if [ $# != 2 ]; then
- echo "usage: $0 dir1 dir2"
+if [ $# -ne 3 ]; then
+ echo "usage: $0 arch dir1 dir2"
exit 1
fi
here=$(pwd)
-dir1=$1
-dir2=$2
-fdir1=$here/$dir1
-fdir2=$here/$dir2
+arch=$1
+dir1=$2
+dir2=$3
+fdir1=$here/${arch}-$dir1
+fdir2=$here/${arch}-$dir2
ldir2=$(cd $fdir2; pwd | sed -e 's/e\./a./')
-of=$here/$dir1-$dir2.html
+of=$here/$arch-$dir1-$dir2.html
echo "Logs that are in $dir1 but not in $dir2" >$of
echo "Logs that are in $dir1 but not in $dir2
" >>$of
echo "" >>$of
cd $fdir1
+logs=$(find . -name \*.log -o -name \*.log.bz2 | sed -e 's/\.log\.bz2/\.log/g')
+nlogs=$(echo $logs | wc -w)
-set *.log
-
-if [ $# = 1 -a "x$1" = "x*.log" ]; then
- echo "No errors" >>$of
+if [ $nlogs -eq 0 ]; then
+ echo "No errors" >>$of;
else
num=0
echo "
" >> $of
echo "$num errors
" >> $of