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"
|
---|
12 | fi
|
---|
13 | wrt_target "$ITERATION" "$PREV"
|
---|
14 | wrt_compare_work "$ITERATION" "$PREV_IT"
|
---|
15 | wrt_logs "$N"
|
---|
16 | PREV_IT=$ITERATION
|
---|
17 | PREV=$ITERATION
|
---|
18 | done
|
---|
19 | }
|
---|
20 |
|
---|
21 | #----------------------------------#
|
---|
22 | wrt_system_build() { #
|
---|
23 | #----------------------------------#
|
---|
24 | local RUN=$1
|
---|
25 |
|
---|
26 | # Placeholder for now
|
---|
27 |
|
---|
28 | echo "system_build_$N: $PREV $chapter6" >> $MKFILE.tmp
|
---|
29 | PREV=system_build_$N
|
---|
30 | }
|
---|
31 |
|
---|
32 | #----------------------------------#
|
---|
33 | wrt_compare_work() { #
|
---|
34 | #----------------------------------#
|
---|
35 | local ITERATION=$1
|
---|
36 | local PREV_IT=$2
|
---|
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"
|
---|
39 |
|
---|
40 | if [[ "$PROGNAME" = "clfs" ]] && [[ "$METHOD" = "boot" ]] ; then
|
---|
41 | local ROOT_DIR=/
|
---|
42 | local DEST_TOPDIR=/jhalfs
|
---|
43 | local ICALOGDIR=/jhalfs/logs/ICA
|
---|
44 | local FARCELOGDIR=/jhalfs/logs/farce
|
---|
45 | else
|
---|
46 | local ROOT_DIR=$BUILDDIR
|
---|
47 | local DEST_TOPDIR=$BUILDDIR/jhalfs
|
---|
48 | fi
|
---|
49 |
|
---|
50 | if [[ "$RUN_ICA" = "1" ]] ; then
|
---|
51 | local DEST_ICA=$DEST_TOPDIR/ICA && \
|
---|
52 | (
|
---|
53 | cat << EOF
|
---|
54 | @extras/do_copy_files "$PRUNEPATH" $ROOT_DIR $DEST_ICA/$ITERATION && \\
|
---|
55 | extras/do_ica_prep $DEST_ICA/$ITERATION
|
---|
56 | EOF
|
---|
57 | ) >> $MKFILE.tmp
|
---|
58 | if [[ "$ITERATION" != "iteration-1" ]] ; then
|
---|
59 | wrt_do_ica_work "$PREV_IT" "$ITERATION" "$DEST_ICA"
|
---|
60 | fi
|
---|
61 | fi
|
---|
62 |
|
---|
63 | if [[ "$RUN_FARCE" = "1" ]] ; then
|
---|
64 | local DEST_FARCE=$DEST_TOPDIR/farce && \
|
---|
65 | (
|
---|
66 | cat << EOF
|
---|
67 | @extras/do_copy_files "$PRUNEPATH" $ROOT_DIR $DEST_FARCE/$ITERATION && \\
|
---|
68 | extras/filelist $DEST_FARCE/$ITERATION $DEST_FARCE/$ITERATION.filelist
|
---|
69 | EOF
|
---|
70 | ) >> $MKFILE.tmp
|
---|
71 | if [[ "$ITERATION" != "iteration-1" ]] ; then
|
---|
72 | wrt_do_farce_work "$PREV_IT" "$ITERATION" "$DEST_FARCE"
|
---|
73 | fi
|
---|
74 | fi
|
---|
75 | }
|
---|
76 |
|
---|
77 | #----------------------------------#
|
---|
78 | wrt_do_ica_work() { #
|
---|
79 | #----------------------------------#
|
---|
80 | echo -e "\t@extras/do_ica_work $1 $2 $ICALOGDIR $3" >> $MKFILE.tmp
|
---|
81 | }
|
---|
82 |
|
---|
83 | #----------------------------------#
|
---|
84 | wrt_do_farce_work() { #
|
---|
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
|
---|
91 | echo -e "\t@extras/farce --directory $OUTPUT $PREDIR $PREFILE $ITEDIR $ITEFILE" >> $MKFILE.tmp
|
---|
92 | }
|
---|
93 |
|
---|
94 | #----------------------------------#
|
---|
95 | wrt_logs() { #
|
---|
96 | #----------------------------------#
|
---|
97 | local ITERATION=iteration$1
|
---|
98 |
|
---|
99 | (
|
---|
100 | cat << EOF
|
---|
101 | @pushd logs && \\
|
---|
102 | mkdir $ITERATION && \\
|
---|
103 | cp ${chapter6}-$N $ITERATION && \\
|
---|
104 | popd
|
---|
105 | @touch \$@
|
---|
106 |
|
---|
107 | EOF
|
---|
108 | ) >> $MKFILE.tmp
|
---|
109 | }
|
---|