#!/bin/sh
##########################################################################
##                                                                      ##
##       this script searches for the necessary binaries and            ##
##       aborts if something isn't found                                ##   
##                                                                      ##
## This program 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 2 of the License, or    ##
## (at your option) any later version.                                  ##
##                                                                      ##
##########################################################################

. config_build
. $SCRIPTS/misc/lib/lib_fail

FILES="perl gzip sed chroot grep"
FAILED="false"

# Lets look if everything is in the path we need
for i in $FILES; do
    if ! which $i >> /dev/null; then
	echo "Sorry, can't find $i !"
	FAILED="true"
    fi
done

# if something was not found we fail
if [ $FAILED = "true" ]; then
    fail
fi

exit 0
