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_compare.sh

116 lines
3 KiB
Bash
Raw Normal View History

# $Id$
#----------------------------------#
wrt_compare_targets() { #
#----------------------------------#
for ((N=1; N <= ITERATIONS ; N++)) ; do # Double parentheses,
# and "ITERATIONS" with no "$".
2006-04-09 17:07:36 +02:00
ITERATION=iteration-$N
if [ "$N" != "1" ] ; then
wrt_system_build "$N"
2006-04-09 17:07:36 +02:00
fi
wrt_target "$ITERATION" "$PREV"
wrt_compare_work "$ITERATION" "$PREV_IT"
wrt_logs "$N"
PREV_IT=$ITERATION
PREV=$ITERATION
2006-04-09 17:07:36 +02:00
done
}
#----------------------------------#
wrt_system_build() { #
#----------------------------------#
local RUN=$1
2006-04-12 00:22:05 +02:00
echo "system_build_$N: $PREV $chapter6" >> $MKFILE.tmp
if [[ "$PROGNAME" = "clfs" ]] && [[ "$METHOD" = "chroot" ]] ; then
final_system_Makefiles $RUN
elif [[ "$PROGNAME" = "clfs" ]] && [[ "$METHOD" = "boot" ]] ; then
bm_final_system_Makefiles $RUN
else
chapter6_Makefiles $RUN
fi
}
#----------------------------------#
wrt_compare_work() { #
2006-04-09 17:07:36 +02:00
#----------------------------------#
local ITERATION=$1
local PREV_IT=$2
2006-04-10 21:35:23 +02:00
local PRUNEPATH="/dev /home /jhalfs /lost+found /media /mnt /opt /proc \
/sources /root /srv /sys /tmp /tools /usr/local /usr/src /var/log/paco"
2006-04-09 17:07:36 +02:00
2006-04-09 17:16:49 +02:00
if [[ "$PROGNAME" = "clfs" ]] && [[ "$METHOD" = "boot" ]] ; then
2006-04-09 22:31:19 +02:00
local ROOT_DIR=/
2006-04-09 17:07:36 +02:00
local DEST_TOPDIR=/jhalfs
2006-04-09 22:31:19 +02:00
local ICALOGDIR=/jhalfs/logs/ICA
local FARCELOGDIR=/jhalfs/logs/farce
2006-04-09 17:07:36 +02:00
else
2006-04-09 22:31:19 +02:00
local ROOT_DIR=$BUILDDIR
2006-04-09 17:07:36 +02:00
local DEST_TOPDIR=$BUILDDIR/jhalfs
fi
if [[ "$RUN_ICA" = "1" ]] ; then
local DEST_ICA=$DEST_TOPDIR/ICA && \
(
cat << EOF
2006-04-10 19:26:20 +02:00
@extras/do_copy_files "$PRUNEPATH" $ROOT_DIR $DEST_ICA/$ITERATION && \\
2006-04-09 17:07:36 +02:00
extras/do_ica_prep $DEST_ICA/$ITERATION
EOF
) >> $MKFILE.tmp
2006-04-09 22:31:19 +02:00
if [[ "$ITERATION" != "iteration-1" ]] ; then
wrt_do_ica_work "$PREV_IT" "$ITERATION" "$DEST_ICA"
2006-04-09 22:31:19 +02:00
fi
2006-04-09 17:07:36 +02:00
fi
if [[ "$RUN_FARCE" = "1" ]] ; then
local DEST_FARCE=$DEST_TOPDIR/farce && \
(
cat << EOF
2006-04-10 19:26:20 +02:00
@extras/do_copy_files "$PRUNEPATH" $ROOT_DIR $DEST_FARCE/$ITERATION && \\
2006-04-09 17:07:36 +02:00
extras/filelist $DEST_FARCE/$ITERATION $DEST_FARCE/$ITERATION.filelist
EOF
) >> $MKFILE.tmp
2006-04-09 22:31:19 +02:00
if [[ "$ITERATION" != "iteration-1" ]] ; then
wrt_do_farce_work "$PREV_IT" "$ITERATION" "$DEST_FARCE"
2006-04-09 22:31:19 +02:00
fi
2006-04-09 17:07:36 +02:00
fi
}
2006-04-09 22:31:19 +02:00
#----------------------------------#
wrt_do_ica_work() { #
#----------------------------------#
echo -e "\t@extras/do_ica_work $1 $2 $ICALOGDIR $3" >> $MKFILE.tmp
2006-04-09 22:31:19 +02:00
}
#----------------------------------#
wrt_do_farce_work() { #
2006-04-09 22:31:19 +02:00
#----------------------------------#
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.tmp
2006-04-09 17:07:36 +02:00
}
2006-04-09 17:07:36 +02:00
#----------------------------------#
wrt_logs() { #
#----------------------------------#
local ITERATION=iteration$1
2006-04-09 17:07:36 +02:00
(
cat << EOF
@pushd logs && \\
mkdir $ITERATION && \\
cp ${chapter6}-$N $ITERATION && \\
2006-04-09 17:07:36 +02:00
popd
2006-04-09 22:31:19 +02:00
@touch \$@
EOF
) >> $MKFILE.tmp
}