source: common/libs/func_compare.sh@ c5ae20a

experimental
Last change on this file since c5ae20a was 9c9775f, checked in by Manuel Canales Esparcia <manuel@…>, 17 years ago

Updated experimental branch to current trunk code.

  • 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"
[9c9775f]17 wrt_touch
[d27c9ca]18 PREV_IT=$ITERATION
[eb024db]19 PREV=$ITERATION
[6794fe4]20 done
21}
22
23#----------------------------------#
[eb024db]24wrt_system_build() { #
25#----------------------------------#
[aa08925]26 local RUN=$1
27 local PREV_IT=$2
[d80021c3]28
[9c9775f]29 if [[ "$PROGNAME" = "clfs" ]] ; then
30 final_system_Makefiles $RUN
[d80021c3]31 else
32 chapter6_Makefiles $RUN
33 fi
34
[a0f4b12]35 if [[ "$PROGNAME" = "clfs" ]] ; then
36 basicsystem="$basicsystem $PREV_IT $system_build"
37 else
38 chapter6="$chapter6 $PREV_IT $system_build"
39 fi
40
41 if [[ "$RUN" = "$ITERATIONS" ]] ; then
42 if [[ "$PROGNAME" = "clfs" ]] ; then
43 basicsystem="$basicsystem iteration-$RUN"
44 else
45 chapter6="$chapter6 iteration-$RUN"
46 fi
47 fi
[eb024db]48}
49
50#----------------------------------#
[d27c9ca]51wrt_compare_work() { #
[6794fe4]52#----------------------------------#
53 local ITERATION=$1
[d27c9ca]54 local PREV_IT=$2
[460ea63]55 local PRUNEPATH="/dev /home /${SCRIPT_ROOT} /lost+found /media /mnt /opt /proc \
[9c9775f]56/sources /root /srv /sys /tmp /tools /usr/local /usr/src"
[6794fe4]57
[a0f4b12]58 local ROOT_DIR=/
59 local DEST_TOPDIR=/${SCRIPT_ROOT}
60 local ICALOGDIR=/${SCRIPT_ROOT}/logs/ICA
61 local FARCELOGDIR=/${SCRIPT_ROOT}/logs/farce
[6794fe4]62
[47fddc8]63 if [[ "$RUN_ICA" = "y" ]] ; then
[6794fe4]64 local DEST_ICA=$DEST_TOPDIR/ICA && \
[bfbd927]65(
66 cat << EOF
[9c9775f]67 @extras/do_copy_files "$PRUNEPATH" $ROOT_DIR $DEST_ICA/$ITERATION >>logs/\$@ 2>&1 && \\
68 extras/do_ica_prep $DEST_ICA/$ITERATION >>logs/\$@ 2>&1
[bfbd927]69EOF
[d27c9ca]70) >> $MKFILE.tmp
[8ba8df4]71 if [[ "$ITERATION" != "iteration-1" ]] ; then
[d27c9ca]72 wrt_do_ica_work "$PREV_IT" "$ITERATION" "$DEST_ICA"
[8ba8df4]73 fi
[6794fe4]74 fi
75
[47fddc8]76 if [[ "$RUN_FARCE" = "y" ]] ; then
[6794fe4]77 local DEST_FARCE=$DEST_TOPDIR/farce && \
[bfbd927]78(
79 cat << EOF
[9c9775f]80 @extras/do_copy_files "$PRUNEPATH" $ROOT_DIR $DEST_FARCE/$ITERATION >>logs/\$@ 2>&1 && \\
81 extras/filelist $DEST_FARCE/$ITERATION $DEST_FARCE/filelist-$ITERATION >>logs/\$@ 2>&1
[bfbd927]82EOF
[d27c9ca]83) >> $MKFILE.tmp
[8ba8df4]84 if [[ "$ITERATION" != "iteration-1" ]] ; then
[d27c9ca]85 wrt_do_farce_work "$PREV_IT" "$ITERATION" "$DEST_FARCE"
[8ba8df4]86 fi
[6794fe4]87 fi
88}
89
[8ba8df4]90#----------------------------------#
91wrt_do_ica_work() { #
92#----------------------------------#
[9c9775f]93 echo -e "\t@extras/do_ica_work $1 $2 $ICALOGDIR $3 >>logs/\$@ 2>&1" >> $MKFILE.tmp
[8ba8df4]94}
95
96#----------------------------------#
[d27c9ca]97wrt_do_farce_work() { #
[8ba8df4]98#----------------------------------#
99 local OUTPUT=$FARCELOGDIR/${1}_V_${2}
100 local PREDIR=$3/$1
[34cabf6]101 local PREFILE=$3/filelist-$1
[8ba8df4]102 local ITEDIR=$3/$2
[34cabf6]103 local ITEFILE=$3/filelist-$2
[9c9775f]104 echo -e "\t@extras/farce --directory $OUTPUT $PREDIR $PREFILE $ITEDIR $ITEFILE >>logs/\$@ 2>&1" >> $MKFILE.tmp
[6794fe4]105}
[bfbd927]106
[6794fe4]107#----------------------------------#
[9199a13]108wrt_logs() { #
[6794fe4]109#----------------------------------#
[9c9775f]110 local build=build_$1
111 local file
[6794fe4]112
113(
114 cat << EOF
[9c9775f]115 @cd logs && \\
116 mkdir $build && \\
117 mv -f ${system_build} $build && \\
118 if [ ! $build = build_1 ] ; then \\
119 cd $build && \\
120 for file in \`ls .\` ; do \\
121 mv -f \$\$file \`echo \$\$file | sed -e 's,-$build,,'\` ; \\
122 done ; \\
123 fi ;
124 @cd /\$(SCRIPT_ROOT)
125 @if [ -d test-logs ] ; then \\
126 cd test-logs && \\
127 mkdir $build && \\
128 mv -f ${system_build} $build && \\
129 if [ ! $build = build_1 ] ; then \\
130 cd $build && \\
131 for file in \`ls .\` ; do \\
132 mv -f \$\$file \`echo \$\$file | sed -e 's,-$build,,'\` ; \\
133 done ; \\
134 fi ; \\
135 cd /\$(SCRIPT_ROOT) ; \\
136 fi ;
[bfbd927]137EOF
[d27c9ca]138) >> $MKFILE.tmp
[bfbd927]139}
Note: See TracBrowser for help on using the repository browser.