Added COMPARE config option to avoid to have to test if RUN_ICA or RUN_FARCE are set.

Changed ICA_rebuild by system_rebuild.
This commit is contained in:
Manuel Canales Esparcia 2006-04-09 11:22:51 +00:00
parent 02d1ae7ee9
commit fb68d2315d
4 changed files with 29 additions and 23 deletions

View file

@ -156,8 +156,8 @@ chapter6_Makefiles() {
case "${this_script}" in
*chroot) continue ;;
*stripping*) [[ "${STRIP}" = "0" ]] && continue
[[ "${STRIP}" != "0" ]] && [[ "$RUN_ICA" != "0" ]] && \
ICA_rebuild="$ICA_rebuild ${this_script}"
[[ "${STRIP}" != "0" ]] && [[ "$COMPARE" != "0" ]] && \
system_rebuild="$system_rebuild ${this_script}"
;;
esac
@ -185,8 +185,8 @@ chapter6_Makefiles() {
if [ "$vrs" != "" ] ; then
FILE="$name-$vrs.tar.*"
wrt_unpack2 "$FILE"
# Add it to the ICA_rebuild target
[[ "$RUN_ICA" != "0" ]] && ICA_rebuild="$ICA_rebuild ${this_script}"
# Add it to the system_rebuild target
[[ "$COMPARE" != "0" ]] && system_rebuild="$system_rebuild ${this_script}"
fi
# In the mount of kernel filesystems we need to set LFS
@ -219,8 +219,8 @@ chapter789_Makefiles() {
#----------------------------#
echo "${tab_}${GREEN}Processing... ${L_arrow}Chapter7/8/9${R_arrow}"
# Reset $PREV for ICA runs
[[ "$RUN_ICA" != "0" ]] && PREV=iteration-last
# Reset $PREV for ICA/farce runs
[[ "$COMPARE" != "0" ]] && PREV=iteration-last
for file in chapter0{7,8,9}/* ; do
# Keep the script file name
@ -401,8 +401,8 @@ restore-lfs-env:
EOF
) >> $MKFILE
# Add the ICA targets
[[ "$RUN_ICA" != "0" ]] && wrt_ica_targets "$ICA_rebuild"
# Add the ICA/farce targets
[[ "$COMPARE" != "0" ]] && wrt_ica_targets "$system_rebuild"
# Bring over the items from the Makefile.tmp
cat $MKFILE.tmp >> $MKFILE

View file

@ -59,16 +59,19 @@ LC_ALL=$LC_ALL # (not used in LFS)
KEYMAP=none
#=== Variables needed by iterative comparison analysis ===
#--- Should some iterative comparison analysis by made? 0(no)/1(yes)
COMPARE=0
#--- The number of final stage builds to create and compare, min. 2, max. 5
ITERATIONS=3
#--- Run ICA testing 0/1 0(no)/1(yes)
#--- Run ICA testing 0(no)/1(yes)
RUN_ICA=0
#--- ICA report log directory
ICALOGDIR=$JHALFSDIR/logs/ICA
#--- Run farce testing 0/1 0(no)/1(yes)
#--- Run farce testing 0(no)/1(yes)
RUN_FARCE=0
#--- farce report log directory

View file

@ -3,18 +3,18 @@
#----------------------------------#
wrt_ica_targets() { #
#----------------------------------#
local ICA_rebuild=$1
wrt_ica_rebuild "$ICA_rebuild"
wrt_iterations "$ICA_rebuild"
local system_rebuild=$1
wrt_system_rebuild "$system_rebuild"
wrt_iterations "$system_rebuild"
}
#----------------------------------#
wrt_ica_rebuild() { #
wrt_system_rebuild() { #
#----------------------------------#
local ICA_rebuild=$1
local system_rebuild=$1
(
cat << EOF
ICA_rebuild: $ICA_rebuild
system_rebuild: $system_rebuild
EOF
) >> $MKFILE
@ -23,7 +23,7 @@ EOF
#----------------------------------#
wrt_iterations() { #
#----------------------------------#
local ICA_rebuild=$1
local system_rebuild=$1
for ((N=1; N <= ITERATIONS ; N++)) ; do # Double parentheses,
# and "ITERATIONS" with no "$".
@ -35,9 +35,9 @@ $ITERATION: chapter06
@do_ica_prep
@pushd logs && \\
mkdir $ITERATION && \\
mv $ICA_rebuild $ITERATION && \\
mv $system_rebuild $ITERATION && \\
popd
@rm -f $ICA_rebuild
@rm -f $system_rebuild
@touch \$@
EOF
@ -50,7 +50,7 @@ iteration-last: $PREV ICA_rebuild
@do_ica_prep
@pushd logs && \\
mkdir iteration-last && \\
cp $ICA_rebuild iteration-last && \\
cp $system_rebuild iteration-last && \\
popd
@do_ica_work
@touch \$@
@ -64,9 +64,9 @@ $ITERATION: $PREV ICA_rebuild
@do_ica_prep
@pushd logs && \\
mkdir $ITERATION && \\
mv $ICA_rebuild $ITERATION && \\
mv $system_rebuild $ITERATION && \\
popd
@rm -f $ICA_rebuild
@rm -f $system_rebuild
@touch \$@
EOF

View file

@ -220,12 +220,15 @@ while test $# -gt 0 ; do
case $1 in
ICA) RUN_ICA=1
RUN_FARCE=0
COMPARE=1
;;
farce) RUN_ICA=0
RUN_FARCE=1
COMPARE=1
;;
both) RUN_ICA=1
RUN_FARCE=1
COMPARE=1
*)
echo -e "\n$1 is an unknown analisys method."
exit 1
@ -478,7 +481,7 @@ fi
if [[ "$PWD" != "$JHALFSDIR" ]]; then
cp $COMMON_DIR/makefile-functions $JHALFSDIR/
if [[ "$RUN_ICA" = "1" ]] || [[ "$RUN_FARCE" = "1" ]]; then
if [[ "$COMPARE" != "0" ]] ; then
mkdir $JHALFSDIR/extras
cp extras/* $JHALFSDIR/extras
fi