2006-04-29 16:44:29 +02:00
|
|
|
# $Id$
|
|
|
|
|
|
|
|
#----------------------------------#
|
|
|
|
wrt_compare_targets() { #
|
|
|
|
#----------------------------------#
|
|
|
|
|
|
|
|
for ((N=1; N <= ITERATIONS ; N++)) ; do # Double parentheses,
|
|
|
|
# and "ITERATIONS" with no "$".
|
|
|
|
ITERATION=iteration-$N
|
|
|
|
if [ "$N" != "1" ] ; then
|
|
|
|
wrt_system_build "$N" "$PREV_IT"
|
|
|
|
fi
|
|
|
|
this_script=$ITERATION
|
2006-10-02 21:32:06 +02:00
|
|
|
CHROOT_wrt_target "$ITERATION" "$PREV"
|
2006-04-29 16:44:29 +02:00
|
|
|
wrt_compare_work "$ITERATION" "$PREV_IT"
|
2006-12-05 16:25:00 +01:00
|
|
|
wrt_logs "$N"
|
2006-12-04 21:58:09 +01:00
|
|
|
wrt_touch
|
2006-04-29 16:44:29 +02:00
|
|
|
PREV_IT=$ITERATION
|
|
|
|
PREV=$ITERATION
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
#----------------------------------#
|
|
|
|
wrt_system_build() { #
|
|
|
|
#----------------------------------#
|
|
|
|
local RUN=$1
|
|
|
|
local PREV_IT=$2
|
|
|
|
|
2007-07-28 13:28:34 +02:00
|
|
|
if [[ "$PROGNAME" = "clfs" ]] ; then
|
|
|
|
final_system_Makefiles $RUN
|
2006-04-29 16:44:29 +02:00
|
|
|
else
|
|
|
|
chapter6_Makefiles $RUN
|
|
|
|
fi
|
|
|
|
|
2006-10-02 21:32:06 +02:00
|
|
|
if [[ "$PROGNAME" = "clfs" ]] ; then
|
|
|
|
basicsystem="$basicsystem $PREV_IT $system_build"
|
|
|
|
else
|
|
|
|
chapter6="$chapter6 $PREV_IT $system_build"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ "$RUN" = "$ITERATIONS" ]] ; then
|
|
|
|
if [[ "$PROGNAME" = "clfs" ]] ; then
|
|
|
|
basicsystem="$basicsystem iteration-$RUN"
|
|
|
|
else
|
|
|
|
chapter6="$chapter6 iteration-$RUN"
|
|
|
|
fi
|
|
|
|
fi
|
2006-04-29 16:44:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#----------------------------------#
|
|
|
|
wrt_compare_work() { #
|
|
|
|
#----------------------------------#
|
|
|
|
local ITERATION=$1
|
|
|
|
local PREV_IT=$2
|
2006-06-01 22:49:41 +02:00
|
|
|
local PRUNEPATH="/dev /home /${SCRIPT_ROOT} /lost+found /media /mnt /opt /proc \
|
2007-03-03 12:58:40 +01:00
|
|
|
/sources /root /srv /sys /tmp /tools /usr/local /usr/src"
|
2006-04-29 16:44:29 +02:00
|
|
|
|
2006-10-02 21:32:06 +02:00
|
|
|
local ROOT_DIR=/
|
|
|
|
local DEST_TOPDIR=/${SCRIPT_ROOT}
|
|
|
|
local ICALOGDIR=/${SCRIPT_ROOT}/logs/ICA
|
|
|
|
local FARCELOGDIR=/${SCRIPT_ROOT}/logs/farce
|
2006-04-29 16:44:29 +02:00
|
|
|
|
2006-08-16 19:42:54 +02:00
|
|
|
if [[ "$RUN_ICA" = "y" ]] ; then
|
2006-04-29 16:44:29 +02:00
|
|
|
local DEST_ICA=$DEST_TOPDIR/ICA && \
|
|
|
|
(
|
|
|
|
cat << EOF
|
2006-12-04 21:58:09 +01:00
|
|
|
@extras/do_copy_files "$PRUNEPATH" $ROOT_DIR $DEST_ICA/$ITERATION >>logs/\$@ 2>&1 && \\
|
|
|
|
extras/do_ica_prep $DEST_ICA/$ITERATION >>logs/\$@ 2>&1
|
2006-04-29 16:44:29 +02:00
|
|
|
EOF
|
|
|
|
) >> $MKFILE.tmp
|
|
|
|
if [[ "$ITERATION" != "iteration-1" ]] ; then
|
|
|
|
wrt_do_ica_work "$PREV_IT" "$ITERATION" "$DEST_ICA"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2006-08-16 19:42:54 +02:00
|
|
|
if [[ "$RUN_FARCE" = "y" ]] ; then
|
2006-04-29 16:44:29 +02:00
|
|
|
local DEST_FARCE=$DEST_TOPDIR/farce && \
|
|
|
|
(
|
|
|
|
cat << EOF
|
2006-12-04 21:58:09 +01:00
|
|
|
@extras/do_copy_files "$PRUNEPATH" $ROOT_DIR $DEST_FARCE/$ITERATION >>logs/\$@ 2>&1 && \\
|
|
|
|
extras/filelist $DEST_FARCE/$ITERATION $DEST_FARCE/filelist-$ITERATION >>logs/\$@ 2>&1
|
2006-04-29 16:44:29 +02:00
|
|
|
EOF
|
|
|
|
) >> $MKFILE.tmp
|
|
|
|
if [[ "$ITERATION" != "iteration-1" ]] ; then
|
|
|
|
wrt_do_farce_work "$PREV_IT" "$ITERATION" "$DEST_FARCE"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
#----------------------------------#
|
|
|
|
wrt_do_ica_work() { #
|
|
|
|
#----------------------------------#
|
2006-12-04 21:58:09 +01:00
|
|
|
echo -e "\t@extras/do_ica_work $1 $2 $ICALOGDIR $3 >>logs/\$@ 2>&1" >> $MKFILE.tmp
|
2006-04-29 16:44:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#----------------------------------#
|
|
|
|
wrt_do_farce_work() { #
|
|
|
|
#----------------------------------#
|
|
|
|
local OUTPUT=$FARCELOGDIR/${1}_V_${2}
|
|
|
|
local PREDIR=$3/$1
|
|
|
|
local PREFILE=$3/filelist-$1
|
|
|
|
local ITEDIR=$3/$2
|
|
|
|
local ITEFILE=$3/filelist-$2
|
2006-12-04 21:58:09 +01:00
|
|
|
echo -e "\t@extras/farce --directory $OUTPUT $PREDIR $PREFILE $ITEDIR $ITEFILE >>logs/\$@ 2>&1" >> $MKFILE.tmp
|
2006-04-29 16:44:29 +02:00
|
|
|
}
|
2006-12-05 16:25:00 +01:00
|
|
|
|
|
|
|
#----------------------------------#
|
|
|
|
wrt_logs() { #
|
|
|
|
#----------------------------------#
|
|
|
|
local build=build_$1
|
|
|
|
local file
|
|
|
|
|
|
|
|
(
|
|
|
|
cat << EOF
|
|
|
|
@cd logs && \\
|
|
|
|
mkdir $build && \\
|
|
|
|
mv -f ${system_build} $build && \\
|
|
|
|
if [ ! $build = build_1 ] ; then \\
|
|
|
|
cd $build && \\
|
|
|
|
for file in \`ls .\` ; do \\
|
|
|
|
mv -f \$\$file \`echo \$\$file | sed -e 's,-$build,,'\` ; \\
|
|
|
|
done ; \\
|
|
|
|
fi ;
|
|
|
|
@cd /\$(SCRIPT_ROOT)
|
|
|
|
@if [ -d test-logs ] ; then \\
|
|
|
|
cd test-logs && \\
|
|
|
|
mkdir $build && \\
|
|
|
|
mv -f ${system_build} $build && \\
|
|
|
|
if [ ! $build = build_1 ] ; then \\
|
|
|
|
cd $build && \\
|
|
|
|
for file in \`ls .\` ; do \\
|
|
|
|
mv -f \$\$file \`echo \$\$file | sed -e 's,-$build,,'\` ; \\
|
|
|
|
done ; \\
|
|
|
|
fi ; \\
|
|
|
|
cd /\$(SCRIPT_ROOT) ; \\
|
|
|
|
fi ;
|
|
|
|
EOF
|
|
|
|
) >> $MKFILE.tmp
|
|
|
|
}
|