source: common/func_compare.sh@ 41b5665

experimental
Last change on this file since 41b5665 was a0f4b12, checked in by Manuel Canales Esparcia <manuel@…>, 18 years ago

Fixed ICA/farce runs, I hope.

  • Property mode set to 100644
File size: 3.7 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
[50fb011]14 CHROOT_wrt_target "$ITERATION" "$PREV"
[d27c9ca]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
[a0f4b12]29 chroot_final_system_Makefiles $RUN
[d80021c3]30 elif [[ "$PROGNAME" = "clfs" ]] && [[ "$METHOD" = "boot" ]] ; then
[a0f4b12]31 boot_final_system_Makefiles $RUN
[d80021c3]32 else
33 chapter6_Makefiles $RUN
34 fi
35
[a0f4b12]36 if [[ "$PROGNAME" = "clfs" ]] ; then
37 basicsystem="$basicsystem $PREV_IT $system_build"
38 else
39 chapter6="$chapter6 $PREV_IT $system_build"
40 fi
41
42 if [[ "$RUN" = "$ITERATIONS" ]] ; then
43 if [[ "$PROGNAME" = "clfs" ]] ; then
44 basicsystem="$basicsystem iteration-$RUN"
45 else
46 chapter6="$chapter6 iteration-$RUN"
47 fi
48 fi
49
[aa08925]50 echo -e "\nsystem_build_$RUN: $PREV_IT $system_build" >> $MKFILE.tmp
[eb024db]51}
52
53#----------------------------------#
[d27c9ca]54wrt_compare_work() { #
[6794fe4]55#----------------------------------#
56 local ITERATION=$1
[d27c9ca]57 local PREV_IT=$2
[460ea63]58 local PRUNEPATH="/dev /home /${SCRIPT_ROOT} /lost+found /media /mnt /opt /proc \
[5112239]59/sources /root /srv /sys /tmp /tools /usr/local /usr/src /var/log/paco"
[6794fe4]60
[a0f4b12]61 local ROOT_DIR=/
62 local DEST_TOPDIR=/${SCRIPT_ROOT}
63 local ICALOGDIR=/${SCRIPT_ROOT}/logs/ICA
64 local FARCELOGDIR=/${SCRIPT_ROOT}/logs/farce
[6794fe4]65
[47fddc8]66 if [[ "$RUN_ICA" = "y" ]] ; then
[6794fe4]67 local DEST_ICA=$DEST_TOPDIR/ICA && \
[bfbd927]68(
69 cat << EOF
[34cabf6]70 @extras/do_copy_files "$PRUNEPATH" $ROOT_DIR $DEST_ICA/$ITERATION >>logs/$ITERATION.log 2>&1 && \\
71 extras/do_ica_prep $DEST_ICA/$ITERATION >>logs/$ITERATION.log 2>&1
[bfbd927]72EOF
[d27c9ca]73) >> $MKFILE.tmp
[8ba8df4]74 if [[ "$ITERATION" != "iteration-1" ]] ; then
[d27c9ca]75 wrt_do_ica_work "$PREV_IT" "$ITERATION" "$DEST_ICA"
[8ba8df4]76 fi
[6794fe4]77 fi
78
[47fddc8]79 if [[ "$RUN_FARCE" = "y" ]] ; then
[6794fe4]80 local DEST_FARCE=$DEST_TOPDIR/farce && \
[bfbd927]81(
82 cat << EOF
[34cabf6]83 @extras/do_copy_files "$PRUNEPATH" $ROOT_DIR $DEST_FARCE/$ITERATION >>logs/$ITERATION.log 2>&1 && \\
84 extras/filelist $DEST_FARCE/$ITERATION $DEST_FARCE/filelist-$ITERATION >>logs/$ITERATION.log 2>&1
[bfbd927]85EOF
[d27c9ca]86) >> $MKFILE.tmp
[8ba8df4]87 if [[ "$ITERATION" != "iteration-1" ]] ; then
[d27c9ca]88 wrt_do_farce_work "$PREV_IT" "$ITERATION" "$DEST_FARCE"
[8ba8df4]89 fi
[6794fe4]90 fi
91}
92
[8ba8df4]93#----------------------------------#
94wrt_do_ica_work() { #
95#----------------------------------#
[34cabf6]96 echo -e "\t@extras/do_ica_work $1 $2 $ICALOGDIR $3 >>logs/$ITERATION.log 2>&1" >> $MKFILE.tmp
[8ba8df4]97}
98
99#----------------------------------#
[d27c9ca]100wrt_do_farce_work() { #
[8ba8df4]101#----------------------------------#
102 local OUTPUT=$FARCELOGDIR/${1}_V_${2}
103 local PREDIR=$3/$1
[34cabf6]104 local PREFILE=$3/filelist-$1
[8ba8df4]105 local ITEDIR=$3/$2
[34cabf6]106 local ITEFILE=$3/filelist-$2
107 echo -e "\t@extras/farce --directory $OUTPUT $PREDIR $PREFILE $ITEDIR $ITEFILE >>logs/$ITERATION.log 2>&1" >> $MKFILE.tmp
[6794fe4]108}
[bfbd927]109
[6794fe4]110#----------------------------------#
[9199a13]111wrt_logs() { #
[6794fe4]112#----------------------------------#
[34cabf6]113 local ITERATION=iteration-$1
[6794fe4]114
115(
116 cat << EOF
[34cabf6]117 @pushd logs 1> /dev/null && \\
[6794fe4]118 mkdir $ITERATION && \\
[4edbc92]119 mv ${LOGS} $ITERATION && \\
[34cabf6]120 popd 1> /dev/null
[9199a13]121 @touch \$@ && \\
[3b63c8c]122 sleep .25 && \\
[9199a13]123 echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
124 echo --------------------------------------------------------------------------------\$(WHITE)
[bfbd927]125EOF
[d27c9ca]126) >> $MKFILE.tmp
[bfbd927]127}
Note: See TracBrowser for help on using the repository browser.