source: common/func_compare.sh@ 2fbc503

experimental
Last change on this file since 2fbc503 was 4edbc92, checked in by Manuel Canales Esparcia <manuel@…>, 19 years ago

Improved logs manegament in iterative builds.

  • Property mode set to 100644
File size: 3.3 KB
RevLine 
[1b9148c]1# $Id$
2
[a5fa1a9]3#----------------------------------#
[d27c9ca]4wrt_compare_targets() { #
[bfbd927]5#----------------------------------#
6
7 for ((N=1; N <= ITERATIONS ; N++)) ; do # Double parentheses,
8 # and "ITERATIONS" with no "$".
[6794fe4]9 ITERATION=iteration-$N
[d27c9ca]10 if [ "$N" != "1" ] ; then
[aa08925]11 wrt_system_build "$N" "$PREV_IT"
[6794fe4]12 fi
[4edbc92]13 this_script=$ITERATION
[d27c9ca]14 wrt_target "$ITERATION" "$PREV"
15 wrt_compare_work "$ITERATION" "$PREV_IT"
16 wrt_logs "$N"
17 PREV_IT=$ITERATION
[eb024db]18 PREV=$ITERATION
[6794fe4]19 done
20}
21
22#----------------------------------#
[eb024db]23wrt_system_build() { #
24#----------------------------------#
[aa08925]25 local RUN=$1
26 local PREV_IT=$2
[d80021c3]27
28 if [[ "$PROGNAME" = "clfs" ]] && [[ "$METHOD" = "chroot" ]] ; then
29 final_system_Makefiles $RUN
30 elif [[ "$PROGNAME" = "clfs" ]] && [[ "$METHOD" = "boot" ]] ; then
31 bm_final_system_Makefiles $RUN
32 else
33 chapter6_Makefiles $RUN
34 fi
35
[aa08925]36 echo -e "\nsystem_build_$RUN: $PREV_IT $system_build" >> $MKFILE.tmp
37 PREV=system_build_$RUN
38
[eb024db]39}
40
41#----------------------------------#
[d27c9ca]42wrt_compare_work() { #
[6794fe4]43#----------------------------------#
44 local ITERATION=$1
[d27c9ca]45 local PREV_IT=$2
[5112239]46 local PRUNEPATH="/dev /home /jhalfs /lost+found /media /mnt /opt /proc \
47/sources /root /srv /sys /tmp /tools /usr/local /usr/src /var/log/paco"
[6794fe4]48
[aab6e73]49 if [[ "$PROGNAME" = "clfs" ]] && [[ "$METHOD" = "boot" ]] ; then
[8ba8df4]50 local ROOT_DIR=/
[6794fe4]51 local DEST_TOPDIR=/jhalfs
[8ba8df4]52 local ICALOGDIR=/jhalfs/logs/ICA
53 local FARCELOGDIR=/jhalfs/logs/farce
[6794fe4]54 else
[8ba8df4]55 local ROOT_DIR=$BUILDDIR
[6794fe4]56 local DEST_TOPDIR=$BUILDDIR/jhalfs
57 fi
58
59 if [[ "$RUN_ICA" = "1" ]] ; then
60 local DEST_ICA=$DEST_TOPDIR/ICA && \
[bfbd927]61(
62 cat << EOF
[34cabf6]63 @extras/do_copy_files "$PRUNEPATH" $ROOT_DIR $DEST_ICA/$ITERATION >>logs/$ITERATION.log 2>&1 && \\
64 extras/do_ica_prep $DEST_ICA/$ITERATION >>logs/$ITERATION.log 2>&1
[bfbd927]65EOF
[d27c9ca]66) >> $MKFILE.tmp
[8ba8df4]67 if [[ "$ITERATION" != "iteration-1" ]] ; then
[d27c9ca]68 wrt_do_ica_work "$PREV_IT" "$ITERATION" "$DEST_ICA"
[8ba8df4]69 fi
[6794fe4]70 fi
71
72 if [[ "$RUN_FARCE" = "1" ]] ; then
73 local DEST_FARCE=$DEST_TOPDIR/farce && \
[bfbd927]74(
75 cat << EOF
[34cabf6]76 @extras/do_copy_files "$PRUNEPATH" $ROOT_DIR $DEST_FARCE/$ITERATION >>logs/$ITERATION.log 2>&1 && \\
77 extras/filelist $DEST_FARCE/$ITERATION $DEST_FARCE/filelist-$ITERATION >>logs/$ITERATION.log 2>&1
[bfbd927]78EOF
[d27c9ca]79) >> $MKFILE.tmp
[8ba8df4]80 if [[ "$ITERATION" != "iteration-1" ]] ; then
[d27c9ca]81 wrt_do_farce_work "$PREV_IT" "$ITERATION" "$DEST_FARCE"
[8ba8df4]82 fi
[6794fe4]83 fi
84}
85
[8ba8df4]86#----------------------------------#
87wrt_do_ica_work() { #
88#----------------------------------#
[34cabf6]89 echo -e "\t@extras/do_ica_work $1 $2 $ICALOGDIR $3 >>logs/$ITERATION.log 2>&1" >> $MKFILE.tmp
[8ba8df4]90}
91
92#----------------------------------#
[d27c9ca]93wrt_do_farce_work() { #
[8ba8df4]94#----------------------------------#
95 local OUTPUT=$FARCELOGDIR/${1}_V_${2}
96 local PREDIR=$3/$1
[34cabf6]97 local PREFILE=$3/filelist-$1
[8ba8df4]98 local ITEDIR=$3/$2
[34cabf6]99 local ITEFILE=$3/filelist-$2
100 echo -e "\t@extras/farce --directory $OUTPUT $PREDIR $PREFILE $ITEDIR $ITEFILE >>logs/$ITERATION.log 2>&1" >> $MKFILE.tmp
[6794fe4]101}
[bfbd927]102
[6794fe4]103#----------------------------------#
104wrt_logs() { #
105#----------------------------------#
[34cabf6]106 local ITERATION=iteration-$1
[6794fe4]107
108(
109 cat << EOF
[34cabf6]110 @pushd logs 1> /dev/null && \\
[6794fe4]111 mkdir $ITERATION && \\
[4edbc92]112 mv ${LOGS} $ITERATION && \\
[34cabf6]113 popd 1> /dev/null
[8ba8df4]114 @touch \$@
[bfbd927]115EOF
[d27c9ca]116) >> $MKFILE.tmp
[bfbd927]117}
Note: See TracBrowser for help on using the repository browser.