#!/bin/sh
# $FreeBSD: ports/Tools/portbuild/scripts/dologs,v 1.23 2010/06/25 23:08:14 linimon Exp $

arch=$1
versions="latest full"

pb=/var/portbuild

. ${pb}/conf/server.conf
. ${pb}/${arch}/portbuild.conf

home=${pb}/errorlogs
scripts=${pb}/scripts

branches=`cd ${pb}/${arch} && ls -d [1-9]* 2> /dev/null`

for version in ${versions}; do
  for branch in ${branches}; do
    dir=$home/$arch-$branch-$version
    test -d $dir && cd $dir && ${scripts}/processlogs ${arch}
    dir=${pb}/${arch}/${branch}
    test -d $dir && cd $dir && ${scripts}/processfail ${arch} ${branch}
  done
  for branch in ${branches}; do
    dir=$home/$arch-$branch-$version-logs
    test -d $dir && cd $dir && ${scripts}/processlogs2
  done
done
