Generating new iteration-N targets and dummy system_build_N targets.
This commit is contained in:
parent
eb024db85b
commit
d27c9ca2fd
2 changed files with 23 additions and 50 deletions
|
@ -214,9 +214,6 @@ chapter789_Makefiles() {
|
|||
#----------------------------#
|
||||
echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter7/8/9${R_arrow}"
|
||||
|
||||
# Reset $PREV for ICA/farce runs
|
||||
[[ "$COMPARE" != "0" ]] && PREV=iteration-last
|
||||
|
||||
for file in chapter0{7,8,9}/* ; do
|
||||
# Keep the script file name
|
||||
this_script=`basename $file`
|
||||
|
@ -306,7 +303,7 @@ build_Makefile() {
|
|||
chapter5_Makefiles
|
||||
chapter6_Makefiles
|
||||
# Add the ICA/farce targets, if needed
|
||||
[[ "$COMPARE" != "0" ]] && wrt_ica_targets
|
||||
[[ "$COMPARE" != "0" ]] && wrt_compare_targets
|
||||
chapter789_Makefiles
|
||||
|
||||
|
||||
|
|
|
@ -1,28 +1,19 @@
|
|||
# $Id$
|
||||
|
||||
#----------------------------------#
|
||||
wrt_ica_targets() { #
|
||||
wrt_compare_targets() { #
|
||||
#----------------------------------#
|
||||
|
||||
for ((N=1; N <= ITERATIONS ; N++)) ; do # Double parentheses,
|
||||
# and "ITERATIONS" with no "$".
|
||||
ITERATION=iteration-$N
|
||||
if [ "$N" = "1" ] ; then
|
||||
echo "$ITERATION: chapter6" >> $MKFILE
|
||||
echo -e "\t@\$(call echo_message, Building)" >> $MKFILE
|
||||
wrt_ica_work "$ITERATION"
|
||||
wrt_logs_and_clean "$ITERATION"
|
||||
else
|
||||
wrt_system_build $N
|
||||
echo "iteration-last: $PREV system_build_$N" >> $MKFILE
|
||||
echo -e "\t@\$(call echo_message, Building)" >> $MKFILE
|
||||
wrt_ica_work "$ITERATION" "$PREV"
|
||||
if [ "$N" = "$ITERATIONS" ] ; then
|
||||
wrt_logs "$ITERATION"
|
||||
else
|
||||
wrt_logs_and_clean "$ITERATION"
|
||||
fi
|
||||
if [ "$N" != "1" ] ; then
|
||||
wrt_system_build "$N"
|
||||
fi
|
||||
wrt_target "$ITERATION" "$PREV"
|
||||
wrt_compare_work "$ITERATION" "$PREV_IT"
|
||||
wrt_logs "$N"
|
||||
PREV_IT=$ITERATION
|
||||
PREV=$ITERATION
|
||||
done
|
||||
}
|
||||
|
@ -33,13 +24,16 @@ wrt_system_build() { #
|
|||
local RUN=$1
|
||||
|
||||
# Placeholder for now
|
||||
|
||||
echo "system_build_$N: $chapter6" >> $MKFILE.tmp
|
||||
PREV=system_build_$N
|
||||
}
|
||||
|
||||
#----------------------------------#
|
||||
wrt_ica_work() { #
|
||||
wrt_compare_work() { #
|
||||
#----------------------------------#
|
||||
local ITERATION=$1
|
||||
local PREV=$2
|
||||
local PREV_IT=$2
|
||||
local PRUNEPATH="/dev /home /jhalfs /lost+found /media /mnt /opt /proc \
|
||||
/sources /root /srv /sys /tmp /tools /usr/local /usr/src /var/log/paco"
|
||||
|
||||
|
@ -60,9 +54,9 @@ wrt_ica_work() { #
|
|||
@extras/do_copy_files "$PRUNEPATH" $ROOT_DIR $DEST_ICA/$ITERATION && \\
|
||||
extras/do_ica_prep $DEST_ICA/$ITERATION
|
||||
EOF
|
||||
) >> $MKFILE
|
||||
) >> $MKFILE.tmp
|
||||
if [[ "$ITERATION" != "iteration-1" ]] ; then
|
||||
wrt_do_ica_work "$PREV" "$ITERATION" "$DEST_ICA"
|
||||
wrt_do_ica_work "$PREV_IT" "$ITERATION" "$DEST_ICA"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -73,9 +67,9 @@ EOF
|
|||
@extras/do_copy_files "$PRUNEPATH" $ROOT_DIR $DEST_FARCE/$ITERATION && \\
|
||||
extras/filelist $DEST_FARCE/$ITERATION $DEST_FARCE/$ITERATION.filelist
|
||||
EOF
|
||||
) >> $MKFILE
|
||||
) >> $MKFILE.tmp
|
||||
if [[ "$ITERATION" != "iteration-1" ]] ; then
|
||||
wrt_do_farce_work "$PREV" "$ITERATION" "$DEST_FARCE"
|
||||
wrt_do_farce_work "$PREV_IT" "$ITERATION" "$DEST_FARCE"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
@ -83,51 +77,33 @@ EOF
|
|||
#----------------------------------#
|
||||
wrt_do_ica_work() { #
|
||||
#----------------------------------#
|
||||
echo -e "\t@extras/do_ica_work $1 $2 $ICALOGDIR $3" >> $MKFILE
|
||||
echo -e "\t@extras/do_ica_work $1 $2 $ICALOGDIR $3" >> $MKFILE.tmp
|
||||
}
|
||||
|
||||
#----------------------------------#
|
||||
wrt_do_farce_work() { #
|
||||
wrt_do_farce_work() { #
|
||||
#----------------------------------#
|
||||
local OUTPUT=$FARCELOGDIR/${1}_V_${2}
|
||||
local PREDIR=$3/$1
|
||||
local PREFILE=$3/$1.filelist
|
||||
local ITEDIR=$3/$2
|
||||
local ITEFILE=$3/$2.filelist
|
||||
echo -e "\t@extras/farce --directory $OUTPUT $PREDIR $PREFILE $ITEDIR $ITEFILE" >> $MKFILE
|
||||
}
|
||||
|
||||
#----------------------------------#
|
||||
wrt_logs_and_clean() { #
|
||||
#----------------------------------#
|
||||
local ITERATION=$1
|
||||
|
||||
(
|
||||
cat << EOF
|
||||
@pushd logs && \\
|
||||
mkdir $ITERATION && \\
|
||||
mv $system_rebuild $ITERATION && \\
|
||||
popd
|
||||
@rm -f $system_rebuild
|
||||
@touch \$@
|
||||
|
||||
EOF
|
||||
) >> $MKFILE
|
||||
echo -e "\t@extras/farce --directory $OUTPUT $PREDIR $PREFILE $ITEDIR $ITEFILE" >> $MKFILE.tmp
|
||||
}
|
||||
|
||||
#----------------------------------#
|
||||
wrt_logs() { #
|
||||
#----------------------------------#
|
||||
local ITERATION=$1
|
||||
local ITERATION=iteration$1
|
||||
|
||||
(
|
||||
cat << EOF
|
||||
@pushd logs && \\
|
||||
mkdir $ITERATION && \\
|
||||
cp $system_rebuild $ITERATION && \\
|
||||
cp ${chapter6}-$N $ITERATION && \\
|
||||
popd
|
||||
@touch \$@
|
||||
|
||||
EOF
|
||||
) >> $MKFILE
|
||||
) >> $MKFILE.tmp
|
||||
}
|
||||
|
|
Reference in a new issue