source: common/libs/func_compare.sh@ 5a9b043

experimental
Last change on this file since 5a9b043 was 111d25a, checked in by Manuel Canales Esparcia <manuel@…>, 17 years ago

Revised func_compare.sh

  • 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}
[111d25a]60 local ICALOGDIR=/${SCRIPT_ROOT}/${LOGDIRBASE}/ICA
61 local FARCELOGDIR=/${SCRIPT_ROOT}/${LOGDIRBASE}/farce
[6794fe4]62
[47fddc8]63 if [[ "$RUN_ICA" = "y" ]] ; then
[6794fe4]64 local DEST_ICA=$DEST_TOPDIR/ICA && \
[bfbd927]65(
66 cat << EOF
[111d25a]67 @extras/do_copy_files "$PRUNEPATH" $ROOT_DIR $DEST_ICA/$ITERATION >> ${LOGDIRBASE}/\$@ 2>&1 && \\
68 extras/do_ica_prep $DEST_ICA/$ITERATION >> ${LOGDIRBASE}/\$@ 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
[111d25a]80 @extras/do_copy_files "$PRUNEPATH" $ROOT_DIR $DEST_FARCE/$ITERATION >> ${LOGDIRBASE}/\$@ 2>&1 && \\
81 extras/filelist $DEST_FARCE/$ITERATION $DEST_FARCE/filelist-$ITERATION >> ${LOGDIRBASE}/\$@ 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#----------------------------------#
[111d25a]93 echo -e "\t@extras/do_ica_work $1 $2 $ICALOGDIR $3 >> ${LOGDIRBASE}/\$@ 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
[111d25a]104 echo -e "\t@extras/farce --directory $OUTPUT $PREDIR $PREFILE $ITEDIR $ITEFILE >> ${LOGDIRBASE}/\$@ 2>&1" >> $MKFILE.tmp
[6794fe4]105}
[bfbd927]106
[6794fe4]107#----------------------------------#
[9199a13]108wrt_logs() { #
[6794fe4]109#----------------------------------#
[9c9775f]110 local build=build_$1
111 local file
[111d25a]112 local ch_order=${PREV%%_*}
[6794fe4]113
[111d25a]114 echo -e "\t@cd /\$(SCRIPT_ROOT)/${LOGDIRBASE} && mkdir $build && mv -f ${ch_order}_* $build" >> $MKFILE.tmp
115
116 if [ ! "${1}" = "1" ] ; then
[6794fe4]117(
118 cat << EOF
[111d25a]119 @cd $build && \\
120 for file in \`ls .\` ; do \\
121 mv -f \$\$file \`echo \$\$file | sed -e 's,-$build,,'\` ; \\
122 done ;
[bfbd927]123EOF
[d27c9ca]124) >> $MKFILE.tmp
[111d25a]125 fi
126
127 if [ ${CONFIG_TESTS} = "y" ] ; then
128 echo -e "\t@cd /\$(SCRIPT_ROOT)/${TESTLOGDIRBASE} && mkdir $build && mv -f ${ch_order}_* $build" >> $MKFILE.tmp
129 fi
130
131 echo -e "\t@cd /\$(SCRIPT_ROOT)" >> $MKFILE.tmp
[bfbd927]132}
Note: See TracBrowser for help on using the repository browser.