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
|
---|
14 | wrt_target "$ITERATION" "$PREV"
|
---|
15 | wrt_compare_work "$ITERATION" "$PREV_IT"
|
---|
16 | wrt_logs "$N"
|
---|
17 | PREV_IT=$ITERATION
|
---|
18 | PREV=$ITERATION
|
---|
19 | done
|
---|
20 | }
|
---|
21 |
|
---|
22 | #----------------------------------#
|
---|
23 | wrt_system_build() { #
|
---|
24 | #----------------------------------#
|
---|
25 | local RUN=$1
|
---|
26 | local PREV_IT=$2
|
---|
27 |
|
---|
28 | if [[ "$PROGNAME" = "clfs" ]] && [[ "$METHOD" = "chroot" ]] ; then
|
---|
29 | final_system_Makefiles $RUN
|
---|
30 | elif [[ "$PROGNAME" = "clfs" ]] && [[ "$METHOD" = "boot" ]] ; then
|
---|
31 | bm_final_system_Makefiles $RUN
|
---|
32 | else
|
---|
33 | chapter6_Makefiles $RUN
|
---|
34 | fi
|
---|
35 |
|
---|
36 | echo -e "\nsystem_build_$RUN: $PREV_IT $system_build" >> $MKFILE.tmp
|
---|
37 | PREV=system_build_$RUN
|
---|
38 |
|
---|
39 | }
|
---|
40 |
|
---|
41 | #----------------------------------#
|
---|
42 | wrt_compare_work() { #
|
---|
43 | #----------------------------------#
|
---|
44 | local ITERATION=$1
|
---|
45 | local PREV_IT=$2
|
---|
46 | local PRUNEPATH="/dev /home /${SCRIPT_ROOT} /lost+found /media /mnt /opt /proc \
|
---|
47 | /sources /root /srv /sys /tmp /tools /usr/local /usr/src /var/log/paco"
|
---|
48 |
|
---|
49 | if [[ "$PROGNAME" = "clfs" ]] && [[ "$METHOD" = "boot" ]] ; then
|
---|
50 | local ROOT_DIR=/
|
---|
51 | local DEST_TOPDIR=/${SCRIPT_ROOT}
|
---|
52 | local ICALOGDIR=/${SCRIPT_ROOT}/logs/ICA
|
---|
53 | local FARCELOGDIR=/${SCRIPT_ROOT}/logs/farce
|
---|
54 | else
|
---|
55 | local ROOT_DIR=$BUILDDIR
|
---|
56 | local DEST_TOPDIR=$BUILDDIR/${SCRIPT_ROOT}
|
---|
57 | fi
|
---|
58 |
|
---|
59 | if [[ "$RUN_ICA" = "1" ]] ; then
|
---|
60 | local DEST_ICA=$DEST_TOPDIR/ICA && \
|
---|
61 | (
|
---|
62 | cat << EOF
|
---|
63 | @extras/do_copy_files "$PRUNEPATH" $ROOT_DIR $DEST_ICA/$ITERATION >>logs/$ITERATION.log 2>&1 && \\
|
---|
64 | extras/do_ica_prep $DEST_ICA/$ITERATION >>logs/$ITERATION.log 2>&1
|
---|
65 | EOF
|
---|
66 | ) >> $MKFILE.tmp
|
---|
67 | if [[ "$ITERATION" != "iteration-1" ]] ; then
|
---|
68 | wrt_do_ica_work "$PREV_IT" "$ITERATION" "$DEST_ICA"
|
---|
69 | fi
|
---|
70 | fi
|
---|
71 |
|
---|
72 | if [[ "$RUN_FARCE" = "1" ]] ; then
|
---|
73 | local DEST_FARCE=$DEST_TOPDIR/farce && \
|
---|
74 | (
|
---|
75 | cat << EOF
|
---|
76 | @extras/do_copy_files "$PRUNEPATH" $ROOT_DIR $DEST_FARCE/$ITERATION >>logs/$ITERATION.log 2>&1 && \\
|
---|
77 | extras/filelist $DEST_FARCE/$ITERATION $DEST_FARCE/filelist-$ITERATION >>logs/$ITERATION.log 2>&1
|
---|
78 | EOF
|
---|
79 | ) >> $MKFILE.tmp
|
---|
80 | if [[ "$ITERATION" != "iteration-1" ]] ; then
|
---|
81 | wrt_do_farce_work "$PREV_IT" "$ITERATION" "$DEST_FARCE"
|
---|
82 | fi
|
---|
83 | fi
|
---|
84 | }
|
---|
85 |
|
---|
86 | #----------------------------------#
|
---|
87 | wrt_do_ica_work() { #
|
---|
88 | #----------------------------------#
|
---|
89 | echo -e "\t@extras/do_ica_work $1 $2 $ICALOGDIR $3 >>logs/$ITERATION.log 2>&1" >> $MKFILE.tmp
|
---|
90 | }
|
---|
91 |
|
---|
92 | #----------------------------------#
|
---|
93 | wrt_do_farce_work() { #
|
---|
94 | #----------------------------------#
|
---|
95 | local OUTPUT=$FARCELOGDIR/${1}_V_${2}
|
---|
96 | local PREDIR=$3/$1
|
---|
97 | local PREFILE=$3/filelist-$1
|
---|
98 | local ITEDIR=$3/$2
|
---|
99 | local ITEFILE=$3/filelist-$2
|
---|
100 | echo -e "\t@extras/farce --directory $OUTPUT $PREDIR $PREFILE $ITEDIR $ITEFILE >>logs/$ITERATION.log 2>&1" >> $MKFILE.tmp
|
---|
101 | }
|
---|
102 |
|
---|
103 | #----------------------------------#
|
---|
104 | wrt_logs() { #
|
---|
105 | #----------------------------------#
|
---|
106 | local ITERATION=iteration-$1
|
---|
107 |
|
---|
108 | (
|
---|
109 | cat << EOF
|
---|
110 | @pushd logs 1> /dev/null && \\
|
---|
111 | mkdir $ITERATION && \\
|
---|
112 | mv ${LOGS} $ITERATION && \\
|
---|
113 | popd 1> /dev/null
|
---|
114 | @touch \$@
|
---|
115 | EOF
|
---|
116 | ) >> $MKFILE.tmp
|
---|
117 | }
|
---|