This repository has been archived on 2024-10-17. You can view files and clone it, but cannot push or open issues or pull requests.
MahiroOS-jhalfs/common/func_ICA.sh
Manuel Canales Esparcia fb68d2315d Added COMPARE config option to avoid to have to test if RUN_ICA or RUN_FARCE are set.
Changed ICA_rebuild by system_rebuild.
2006-04-09 11:22:51 +00:00

77 lines
1.4 KiB
Bash

# $Id$
#----------------------------------#
wrt_ica_targets() { #
#----------------------------------#
local system_rebuild=$1
wrt_system_rebuild "$system_rebuild"
wrt_iterations "$system_rebuild"
}
#----------------------------------#
wrt_system_rebuild() { #
#----------------------------------#
local system_rebuild=$1
(
cat << EOF
system_rebuild: $system_rebuild
EOF
) >> $MKFILE
}
#----------------------------------#
wrt_iterations() { #
#----------------------------------#
local system_rebuild=$1
for ((N=1; N <= ITERATIONS ; N++)) ; do # Double parentheses,
# and "ITERATIONS" with no "$".
ITERATION=iteration-$N
if [ "$N" = "1" ] ; then
(
cat << EOF
$ITERATION: chapter06
@do_ica_prep
@pushd logs && \\
mkdir $ITERATION && \\
mv $system_rebuild $ITERATION && \\
popd
@rm -f $system_rebuild
@touch \$@
EOF
) >> $MKFILE
PREV=$ITERATION
elif [ "$N" = "$ITERATIONS" ] ; then
(
cat << EOF
iteration-last: $PREV ICA_rebuild
@do_ica_prep
@pushd logs && \\
mkdir iteration-last && \\
cp $system_rebuild iteration-last && \\
popd
@do_ica_work
@touch \$@
EOF
) >> $MKFILE
else
(
cat << EOF
$ITERATION: $PREV ICA_rebuild
@do_ica_prep
@pushd logs && \\
mkdir $ITERATION && \\
mv $system_rebuild $ITERATION && \\
popd
@rm -f $system_rebuild
@touch \$@
EOF
) >> $MKFILE
PREV=$ITERATION
fi
done
}