#! /bin/sh
# Script to check out a tree for use by gen-all.
#
#   Copyright 2012 Free Software Foundation
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; see the file COPYING3.  If not see
# <http://www.gnu.org/licenses/>.
#

if [ $# != 1 ]
then
    echo "missing sourceware id" >&2
    exit 1
fi

id=$1

rm -f co-gcc.log
svn co svn+ssh://${id}@gcc.gnu.org/svn/gcc/trunk gcc >& co-gcc.log

rm -f co-binutils.log
cvs -d :ext:${id}@sourceware.org:/cvs/src co binutils >& co-binutils.log

rm -f co-cgen.log
cvs -d :ext:${id}@sourceware.org:/cvs/src co naked-cgen >& co-cgen.log

rm -f co-sid.log
sid_modules="naked-sid naked-tcl naked-tk"
cvs -d :ext:${id}@sourceware.org:/cvs/src co ${sid_modules} >& co-sid.log

rm -f co-gdb.log
gdb_modules="naked-gdb naked-sim naked-readline naked-libdecnumber"
cvs -d :ext:${id}@sourceware.org:/cvs/src co ${gdb_modules} >& co-gdb.log

rm -f co-newlib.log
newlib_modules="naked-newlib naked-libgloss"
cvs -d :ext:${id}@sourceware.org:/cvs/src co ${dejagnu_modules} >& co-newlib.log

# dejagnu is gone from sourceware
#rm -f co-dejagnu.log
#dejagnu_modules="naked-dejagnu naked-expect"
#cvs -d :ext:${id}@sourceware.org:/cvs/src co ${dejagnu_modules} >& co-dejagnu.log

for pkg in gcc binutils cgen sid gdb newlib
do
    echo "-------------------"
    echo "Updated in $pkg ..."
    grep "^U " co-${pkg}.log
done

for pkg in gcc binutils cgen sid gdb newlib
do
    echo "-------------------"
    echo "New/modified in $pkg ..."
    grep "^[AMC] " co-${pkg}.log
done
