[45f82718] | 1 | # $Id$
|
---|
| 2 |
|
---|
| 3 | #----------------------------------#
|
---|
| 4 | wrt_compare_targets() { #
|
---|
| 5 | #----------------------------------#
|
---|
| 6 |
|
---|
| 7 | for ((N=1; N <= ITERATIONS ; N++)) ; do # Double parentheses,
|
---|
| 8 | # and "ITERATIONS" with no "$".
|
---|
| 9 | ITERATION=iteration-$N
|
---|
| 10 | if [ "$N" != "1" ] ; then
|
---|
| 11 | wrt_system_build "$N" "$PREV_IT"
|
---|
| 12 | fi
|
---|
| 13 | this_script=$ITERATION
|
---|
[045b2dc] | 14 | CHROOT_wrt_target "$ITERATION" "$PREV"
|
---|
[45f82718] | 15 | wrt_compare_work "$ITERATION" "$PREV_IT"
|
---|
[10c8b78] | 16 | wrt_logs "$N"
|
---|
[6bb080e] | 17 | wrt_touch
|
---|
[45f82718] | 18 | PREV_IT=$ITERATION
|
---|
| 19 | PREV=$ITERATION
|
---|
| 20 | done
|
---|
| 21 | }
|
---|
| 22 |
|
---|
| 23 | #----------------------------------#
|
---|
| 24 | wrt_system_build() { #
|
---|
| 25 | #----------------------------------#
|
---|
| 26 | local RUN=$1
|
---|
| 27 | local PREV_IT=$2
|
---|
| 28 |
|
---|
[7a84ba7] | 29 | if [[ "$PROGNAME" = "clfs" ]] ; then
|
---|
| 30 | final_system_Makefiles $RUN
|
---|
[45f82718] | 31 | else
|
---|
| 32 | chapter6_Makefiles $RUN
|
---|
| 33 | fi
|
---|
| 34 |
|
---|
[045b2dc] | 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
|
---|
[45f82718] | 48 | }
|
---|
| 49 |
|
---|
| 50 | #----------------------------------#
|
---|
| 51 | wrt_compare_work() { #
|
---|
| 52 | #----------------------------------#
|
---|
| 53 | local ITERATION=$1
|
---|
| 54 | local PREV_IT=$2
|
---|
[1a1f099] | 55 | local PRUNEPATH="/dev /home /${SCRIPT_ROOT} /lost+found /media /mnt /opt /proc \
|
---|
[daa489d] | 56 | /sources /root /srv /sys /tmp /tools /usr/local /usr/src"
|
---|
[45f82718] | 57 |
|
---|
[045b2dc] | 58 | local ROOT_DIR=/
|
---|
| 59 | local DEST_TOPDIR=/${SCRIPT_ROOT}
|
---|
| 60 | local ICALOGDIR=/${SCRIPT_ROOT}/logs/ICA
|
---|
| 61 | local FARCELOGDIR=/${SCRIPT_ROOT}/logs/farce
|
---|
[45f82718] | 62 |
|
---|
[401f81e] | 63 | if [[ "$RUN_ICA" = "y" ]] ; then
|
---|
[45f82718] | 64 | local DEST_ICA=$DEST_TOPDIR/ICA && \
|
---|
| 65 | (
|
---|
| 66 | cat << EOF
|
---|
[6bb080e] | 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
|
---|
[45f82718] | 69 | EOF
|
---|
| 70 | ) >> $MKFILE.tmp
|
---|
| 71 | if [[ "$ITERATION" != "iteration-1" ]] ; then
|
---|
| 72 | wrt_do_ica_work "$PREV_IT" "$ITERATION" "$DEST_ICA"
|
---|
| 73 | fi
|
---|
| 74 | fi
|
---|
| 75 |
|
---|
[401f81e] | 76 | if [[ "$RUN_FARCE" = "y" ]] ; then
|
---|
[45f82718] | 77 | local DEST_FARCE=$DEST_TOPDIR/farce && \
|
---|
| 78 | (
|
---|
| 79 | cat << EOF
|
---|
[6bb080e] | 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
|
---|
[45f82718] | 82 | EOF
|
---|
| 83 | ) >> $MKFILE.tmp
|
---|
| 84 | if [[ "$ITERATION" != "iteration-1" ]] ; then
|
---|
| 85 | wrt_do_farce_work "$PREV_IT" "$ITERATION" "$DEST_FARCE"
|
---|
| 86 | fi
|
---|
| 87 | fi
|
---|
| 88 | }
|
---|
| 89 |
|
---|
| 90 | #----------------------------------#
|
---|
| 91 | wrt_do_ica_work() { #
|
---|
| 92 | #----------------------------------#
|
---|
[6bb080e] | 93 | echo -e "\t@extras/do_ica_work $1 $2 $ICALOGDIR $3 >>logs/\$@ 2>&1" >> $MKFILE.tmp
|
---|
[45f82718] | 94 | }
|
---|
| 95 |
|
---|
| 96 | #----------------------------------#
|
---|
| 97 | wrt_do_farce_work() { #
|
---|
| 98 | #----------------------------------#
|
---|
| 99 | local OUTPUT=$FARCELOGDIR/${1}_V_${2}
|
---|
| 100 | local PREDIR=$3/$1
|
---|
| 101 | local PREFILE=$3/filelist-$1
|
---|
| 102 | local ITEDIR=$3/$2
|
---|
| 103 | local ITEFILE=$3/filelist-$2
|
---|
[6bb080e] | 104 | echo -e "\t@extras/farce --directory $OUTPUT $PREDIR $PREFILE $ITEDIR $ITEFILE >>logs/\$@ 2>&1" >> $MKFILE.tmp
|
---|
[45f82718] | 105 | }
|
---|
[10c8b78] | 106 |
|
---|
| 107 | #----------------------------------#
|
---|
| 108 | wrt_logs() { #
|
---|
| 109 | #----------------------------------#
|
---|
| 110 | local build=build_$1
|
---|
| 111 | local file
|
---|
| 112 |
|
---|
| 113 | (
|
---|
| 114 | cat << EOF
|
---|
| 115 | @cd logs && \\
|
---|
| 116 | mkdir $build && \\
|
---|
[b7515ec] | 117 | mv -f `echo ${system_build} | sed 's/ /* /g'`* $build && \\
|
---|
[10c8b78] | 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 && \\
|
---|
[7fa9369] | 128 | mv -f `echo ${system_build} | sed 's/ /* /g'`* $build && \\
|
---|
[10c8b78] | 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 ;
|
---|
| 137 | EOF
|
---|
| 138 | ) >> $MKFILE.tmp
|
---|
| 139 | }
|
---|