#!/bin/bash

echo "-------------------------------------------------------------------------------------------------------------"
KEY="x"
#while [ "$KEY" != "y" ]; do
 echo
 echo "The update and install procedure has to be repeated until all errors are gone!"
 echo
 echo -n "   Do an update and installation of missing system tools? (y/n)? "; read -n 1 -s YESNO; echo
 [ "$YESNO" = "n" ] &&  KEY="y"
 [ "$YESNO" = "n" ] || [ "$YESNO" = "y" ] || echo "wrong key!"
if [ "$YESNO" = "y" ]; then
	EXTRAPKG=
	. ./install-tools2
fi
#done
echo "-------------------------------------------------------------------------------------------------------------"
echo "Install tools ..." 
echo 
echo 

make toolsdirclean
#dont do 'svn co' or 'or svn up'  because ./tools/config is from a different source!"
#and some changes are also made to the sources especially concerning ./tools/config
#svn co http://svn.freetz.org/trunk/tools tools -r 2367 (used up to 31.12.2008)
#svn co http://svn.freetz.org/trunk/tools tools -r 3643
#revision update done, Makefile is different to Freetz, only tools/make dir is used.
#fakeroot.mk uses different paths 
#included binarys are made with knoppix DVD 5.1
#svn up
export K_ONLY=0 # if set to 1 only build kconfig
make tools
echo "Installation finished!"
sleep 10