2009-01-10 01:26:30 +01:00
|
|
|
#!/bin/bash
|
|
|
|
OK=0
|
|
|
|
FAIL=1
|
|
|
|
TOPDIR=`pwd`
|
|
|
|
LOG_FILE=$1.log
|
|
|
|
LOG_DIR=${TOPDIR}/log/
|
|
|
|
LOG=${LOG_DIR}/${LOG_FILE}
|
|
|
|
DEPENDENCY=${LOG_DIR}/DEPEND/$1.depend.txt
|
|
|
|
|
|
|
|
LOG_OK_DIR=${LOG_DIR}/OK
|
|
|
|
LOG_FAIL_DIR=${LOG_DIR}/FAIL
|
|
|
|
LOG_OK_FILE=${LOG_OK_DIR}/${LOG_FILE}.OK
|
|
|
|
LOG_FAIL_FILE=${LOG_FAIL_DIR}/${LOG_FILE}.FAIL
|
|
|
|
|
|
|
|
mkdir -p ${LOG_DIR}
|
|
|
|
mkdir -p ${LOG_OK_DIR}
|
|
|
|
mkdir -p ${LOG_FAIL_DIR}
|
|
|
|
mkdir -p ${LOG_DIR}/DEPEND
|
|
|
|
|
|
|
|
test=${OK}
|
|
|
|
|
2009-01-16 00:17:38 +01:00
|
|
|
function clean_files()
|
2009-01-10 01:26:30 +01:00
|
|
|
{
|
2009-01-11 21:37:04 +01:00
|
|
|
rm -f ${LOG}
|
|
|
|
rm -f ${LOG_OK_FILE}
|
|
|
|
rm -f ${LOG_FAIL_FILE}
|
2009-01-10 01:26:30 +01:00
|
|
|
rm -f ${DEPENDENCY}
|
2009-01-16 00:17:38 +01:00
|
|
|
}
|
2009-01-10 01:26:30 +01:00
|
|
|
|
2009-01-16 00:17:38 +01:00
|
|
|
function dirclean ()
|
|
|
|
{
|
2009-01-10 01:26:30 +01:00
|
|
|
make $1-dirclean > /dev/null 2>&1
|
2009-01-16 00:17:38 +01:00
|
|
|
}
|
2009-01-10 01:26:30 +01:00
|
|
|
|
2009-01-16 00:17:38 +01:00
|
|
|
function process ()
|
|
|
|
{
|
2009-01-10 01:26:30 +01:00
|
|
|
make $1 >> ${LOG} 2>&1 || test=${FAIL}
|
|
|
|
grep "\.tar\." ${LOG} > ${DEPENDENCY}
|
2010-09-20 23:26:08 +02:00
|
|
|
if [ ${test} = ${OK} ] ; then
|
2009-01-10 01:26:30 +01:00
|
|
|
mv ${LOG} ${LOG_OK_FILE}
|
2009-01-26 00:09:12 +01:00
|
|
|
printf "%-16s" "OK"
|
|
|
|
if [ "${2}X" != "X" ] ; then
|
|
|
|
printf "%-16s" "\"$2\"";
|
|
|
|
fi
|
|
|
|
if [ "${3}X" != "X" ] ; then
|
|
|
|
printf "%s" "\"$3\"";
|
|
|
|
fi
|
|
|
|
echo
|
2009-01-10 01:26:30 +01:00
|
|
|
else
|
|
|
|
mv ${LOG} ${LOG_FAIL_FILE}
|
2009-01-26 00:09:12 +01:00
|
|
|
printf "%-16s" "FAIL"
|
|
|
|
if [ "${2}X" != "X" ] ; then
|
|
|
|
printf "%-16s" "\"$2\"";
|
|
|
|
else
|
|
|
|
printf "%-16s" "\"\""
|
|
|
|
fi
|
|
|
|
if [ "${3}X" != "X" ] ; then
|
|
|
|
printf "%s" "\"$3\"";
|
|
|
|
fi
|
|
|
|
echo
|
2009-01-10 01:26:30 +01:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2009-01-16 00:17:38 +01:00
|
|
|
function build_package ()
|
|
|
|
{
|
2009-01-26 00:09:12 +01:00
|
|
|
# echo "BUILD PACKAGE:1=$1 2=$2 3=$3 4=$4 5=$5 6=$6 7=$7"
|
|
|
|
printf "mk %-32s" "$1"
|
2010-09-20 23:26:08 +02:00
|
|
|
if [ "$2X" = "X" ] ; then # no parameters
|
2009-01-16 00:17:38 +01:00
|
|
|
clean_files $1
|
|
|
|
dirclean $1
|
2009-01-26 00:09:12 +01:00
|
|
|
process $1 "$3"
|
2010-09-20 23:26:08 +02:00
|
|
|
elif [ "$2X" = "?X" ] ; then # no parameters
|
2009-01-26 00:09:12 +01:00
|
|
|
clean_files $1
|
|
|
|
dirclean $1
|
|
|
|
process $1 "$3"
|
2010-09-20 23:26:08 +02:00
|
|
|
elif [ "$2X" = "OKX" ] ; then # Previous build was OK
|
2009-01-16 00:17:38 +01:00
|
|
|
clean_files $1
|
|
|
|
dirclean $1
|
2009-01-26 00:09:12 +01:00
|
|
|
process $1 "$3"
|
2010-09-20 23:26:08 +02:00
|
|
|
elif [ "$2X" = "FAILX" ] ; then
|
2009-01-16 00:17:38 +01:00
|
|
|
clean_files $1
|
|
|
|
dirclean $1
|
2009-01-26 00:09:12 +01:00
|
|
|
process $1 "$3"
|
2010-09-20 23:26:08 +02:00
|
|
|
elif [ "$2X" = "BROKENX" ] ; then
|
2009-01-26 00:09:12 +01:00
|
|
|
printf "%-16s" "BROKEN"
|
|
|
|
if [ "${3}X" != "X" ] ; then
|
|
|
|
printf "%s" "\"$3\"";
|
|
|
|
fi
|
|
|
|
echo
|
2010-09-20 23:26:08 +02:00
|
|
|
elif [ "$2X" = "DISABLEDX" ] ; then
|
2009-01-26 00:09:12 +01:00
|
|
|
printf "%-16s" "DISABLED"
|
|
|
|
if [ "${3}X" != "X" ] ; then
|
|
|
|
printf "%s" "\"$3\"";
|
|
|
|
fi
|
|
|
|
echo
|
|
|
|
else
|
|
|
|
printf "%-16s" "?BROKEN"
|
|
|
|
if [ "${3}X" != "X" ] ; then
|
|
|
|
printf "%s" "\"$3\"";
|
|
|
|
fi
|
|
|
|
echo
|
2009-01-16 00:17:38 +01:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2009-01-26 00:09:12 +01:00
|
|
|
#build_package $1 $2 "\"$3\""
|
|
|
|
build_package $1 $2 "$3"
|
2009-01-16 00:17:38 +01:00
|
|
|
|
2009-01-10 01:26:30 +01:00
|
|
|
|
|
|
|
|