From fb68d2315d5ecaccf98e577408387d0285e163ad Mon Sep 17 00:00:00 2001 From: Manuel Canales Esparcia Date: Sun, 9 Apr 2006 11:22:51 +0000 Subject: [PATCH] Added COMPARE config option to avoid to have to test if RUN_ICA or RUN_FARCE are set. Changed ICA_rebuild by system_rebuild. --- LFS/master.sh | 16 ++++++++-------- common/config | 7 +++++-- common/func_ICA.sh | 24 ++++++++++++------------ master.sh | 5 ++++- 4 files changed, 29 insertions(+), 23 deletions(-) diff --git a/LFS/master.sh b/LFS/master.sh index 5b69916..a4aadb8 100755 --- a/LFS/master.sh +++ b/LFS/master.sh @@ -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 diff --git a/common/config b/common/config index e40c5d5..4307218 100644 --- a/common/config +++ b/common/config @@ -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 diff --git a/common/func_ICA.sh b/common/func_ICA.sh index 181fbfb..22cb790 100644 --- a/common/func_ICA.sh +++ b/common/func_ICA.sh @@ -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 diff --git a/master.sh b/master.sh index e16e0c9..54a1c7b 100755 --- a/master.sh +++ b/master.sh @@ -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