Added wrt_do_X_work functions.

This commit is contained in:
Manuel Canales Esparcia 2006-04-09 20:31:19 +00:00
parent a101844a48
commit 8ba8df489f
2 changed files with 40 additions and 16 deletions

View file

@ -68,18 +68,18 @@ ITERATIONS=3
#--- Run ICA testing 0(no)/1(yes)
RUN_ICA=0
#--- ICA report log directory
ICALOGDIR=$JHALFSDIR/logs/ICA
#--- Run farce testing 0(no)/1(yes)
RUN_FARCE=0
#--- farce report log directory
FARCELOGDIR=$JHALFSDIR/logs/farce
#==== INTERNAL VARIABLES ====
# Don't edit it unless you know what you are doing
#--- Working directories
JHALFSDIR=$BUILDDIR/jhalfs
LOGDIR=$JHALFSDIR/logs
#--- ICA report log directory
ICALOGDIR=$LOGDIR/ICA
#--- farce report log directory
FARCELOGDIR=$LOGDIR/farce

View file

@ -32,21 +32,15 @@ wrt_iterations() { #
echo "$ITERATION: chapter06" >> $MKFILE
wrt_prepare "$ITERATION"
wrt_logs_and_clean "$ITERATION"
echo -e "\t@touch \$@\n" >> $MKFILE
PREV=$ITERATION
elif [ "$N" = "$ITERATIONS" ] ; then
echo "iteration-last: $PREV system_rebuild" >> $MKFILE
wrt_prepare "$ITERATION"
wrt_prepare "$ITERATION" "$PREV"
wrt_logs "$ITERATION"
#I need to gigure out how to handle this for ITERATIONS > 2
# @do_ica_work $1 $2
# @farce $1 $2
echo -e "\t@touch \$@\n" >> $MKFILE
else
echo "$ITERATION: $PREV system_rebuild" >> $MKFILE
wrt_prepare "$ITERATION"
wrt_prepare "$ITERATION" "$PREV"
wrt_logs_and_clean "$ITERATION"
echo -e "\t@touch \$@\n" >> $MKFILE
PREV=$ITERATION
fi
done
@ -56,18 +50,21 @@ wrt_iterations() { #
wrt_prepare() { #
#----------------------------------#
local ITERATION=$1
local PREV=$2
if [[ "$PROGNAME" = "clfs" ]] && [[ "$METHOD" = "boot" ]] ; then
local PRUNEPATH="/jhalfs /sources /var/log/paco /opt /dev /home /mnt /proc \
/root /sys /tmp /usr/src /lost+found /tools"
local ROOT_DIR=/
local ROOT_DIR=/
local DEST_TOPDIR=/jhalfs
local ICALOGDIR=/jhalfs/logs/ICA
local FARCELOGDIR=/jhalfs/logs/farce
else
local PRUNEPATH="$BUILDDIR/jhalfs $BUILDDIR/sources $BUILDDIR/var/log/paco \
$BUILDDIR/opt $BUILDDIR/dev $BUILDDIR/home $BUILDDIR/mnt \
$BUILDDIR/proc $BUILDDIR/root $BUILDDIR/sys $BUILDDIR/tmp \
$BUILDDIR/usr/src $BUILDDIR/lost+found $BUILDDIR/tools"
local ROOT_DIR=$BUILDDIR
local ROOT_DIR=$BUILDDIR
local DEST_TOPDIR=$BUILDDIR/jhalfs
fi
@ -79,6 +76,9 @@ $BUILDDIR/usr/src $BUILDDIR/lost+found $BUILDDIR/tools"
extras/do_ica_prep $DEST_ICA/$ITERATION
EOF
) >> $MKFILE
if [[ "$ITERATION" != "iteration-1" ]] ; then
wrt_do_ica_work "$PREV" "$ITERATION" "$DEST_ICA"
fi
fi
if [[ "$RUN_FARCE" = "1" ]] ; then
@ -89,9 +89,29 @@ EOF
extras/filelist $DEST_FARCE/$ITERATION $DEST_FARCE/$ITERATION.filelist
EOF
) >> $MKFILE
if [[ "$ITERATION" != "iteration-1" ]] ; then
wrt_do_farce_work "$PREV" "$ITERATION" "$DEST_FARCE"
fi
fi
}
#----------------------------------#
wrt_do_ica_work() { #
#----------------------------------#
echo -e "\t@extras/do_ica_work $1 $2 $ICALOGDIR $3" >> $MKFILE
}
#----------------------------------#
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() { #
#----------------------------------#
@ -104,6 +124,8 @@ wrt_logs_and_clean() { #
mv $system_rebuild $ITERATION && \\
popd
@rm -f $system_rebuild
@touch \$@
EOF
) >> $MKFILE
}
@ -119,6 +141,8 @@ wrt_logs() { #
mkdir $ITERATION && \\
cp $system_rebuild $ITERATION && \\
popd
@touch \$@
EOF
) >> $MKFILE
}