source: common/func_compare.sh@ d6614ab

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

Code fix

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