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 | CHROOT_wrt_target "$ITERATION" "$PREV"
|
---|
15 | wrt_compare_work "$ITERATION" "$PREV_IT"
|
---|
16 | wrt_touch
|
---|
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 | chroot_final_system_Makefiles $RUN
|
---|
30 | elif [[ "$PROGNAME" = "clfs" ]] && [[ "$METHOD" = "boot" ]] ; then
|
---|
31 | boot_final_system_Makefiles $RUN
|
---|
32 | else
|
---|
33 | chapter6_Makefiles $RUN
|
---|
34 | fi
|
---|
35 |
|
---|
36 | if [[ "$PROGNAME" = "clfs" ]] ; then
|
---|
37 | basicsystem="$basicsystem $PREV_IT $system_build"
|
---|
38 | else
|
---|
39 | chapter6="$chapter6 $PREV_IT $system_build"
|
---|
40 | fi
|
---|
41 |
|
---|
42 | if [[ "$RUN" = "$ITERATIONS" ]] ; then
|
---|
43 | if [[ "$PROGNAME" = "clfs" ]] ; then
|
---|
44 | basicsystem="$basicsystem iteration-$RUN"
|
---|
45 | else
|
---|
46 | chapter6="$chapter6 iteration-$RUN"
|
---|
47 | fi
|
---|
48 | fi
|
---|
49 |
|
---|
50 | echo -e "\nsystem_build_$RUN: $PREV_IT $system_build" >> $MKFILE.tmp
|
---|
51 | }
|
---|
52 |
|
---|
53 | #----------------------------------#
|
---|
54 | wrt_compare_work() { #
|
---|
55 | #----------------------------------#
|
---|
56 | local ITERATION=$1
|
---|
57 | local PREV_IT=$2
|
---|
58 | local PRUNEPATH="/dev /home /${SCRIPT_ROOT} /lost+found /media /mnt /opt /proc \
|
---|
59 | /sources /root /srv /sys /tmp /tools /usr/local /usr/src /var/log/paco"
|
---|
60 |
|
---|
61 | local ROOT_DIR=/
|
---|
62 | local DEST_TOPDIR=/${SCRIPT_ROOT}
|
---|
63 | local ICALOGDIR=/${SCRIPT_ROOT}/logs/ICA
|
---|
64 | local FARCELOGDIR=/${SCRIPT_ROOT}/logs/farce
|
---|
65 |
|
---|
66 | if [[ "$RUN_ICA" = "y" ]] ; then
|
---|
67 | local DEST_ICA=$DEST_TOPDIR/ICA && \
|
---|
68 | (
|
---|
69 | cat << EOF
|
---|
70 | @extras/do_copy_files "$PRUNEPATH" $ROOT_DIR $DEST_ICA/$ITERATION >>logs/\$@ 2>&1 && \\
|
---|
71 | extras/do_ica_prep $DEST_ICA/$ITERATION >>logs/\$@ 2>&1
|
---|
72 | EOF
|
---|
73 | ) >> $MKFILE.tmp
|
---|
74 | if [[ "$ITERATION" != "iteration-1" ]] ; then
|
---|
75 | wrt_do_ica_work "$PREV_IT" "$ITERATION" "$DEST_ICA"
|
---|
76 | fi
|
---|
77 | fi
|
---|
78 |
|
---|
79 | if [[ "$RUN_FARCE" = "y" ]] ; then
|
---|
80 | local DEST_FARCE=$DEST_TOPDIR/farce && \
|
---|
81 | (
|
---|
82 | cat << EOF
|
---|
83 | @extras/do_copy_files "$PRUNEPATH" $ROOT_DIR $DEST_FARCE/$ITERATION >>logs/\$@ 2>&1 && \\
|
---|
84 | extras/filelist $DEST_FARCE/$ITERATION $DEST_FARCE/filelist-$ITERATION >>logs/\$@ 2>&1
|
---|
85 | EOF
|
---|
86 | ) >> $MKFILE.tmp
|
---|
87 | if [[ "$ITERATION" != "iteration-1" ]] ; then
|
---|
88 | wrt_do_farce_work "$PREV_IT" "$ITERATION" "$DEST_FARCE"
|
---|
89 | fi
|
---|
90 | fi
|
---|
91 | }
|
---|
92 |
|
---|
93 | #----------------------------------#
|
---|
94 | wrt_do_ica_work() { #
|
---|
95 | #----------------------------------#
|
---|
96 | echo -e "\t@extras/do_ica_work $1 $2 $ICALOGDIR $3 >>logs/\$@ 2>&1" >> $MKFILE.tmp
|
---|
97 | }
|
---|
98 |
|
---|
99 | #----------------------------------#
|
---|
100 | wrt_do_farce_work() { #
|
---|
101 | #----------------------------------#
|
---|
102 | local OUTPUT=$FARCELOGDIR/${1}_V_${2}
|
---|
103 | local PREDIR=$3/$1
|
---|
104 | local PREFILE=$3/filelist-$1
|
---|
105 | local ITEDIR=$3/$2
|
---|
106 | local ITEFILE=$3/filelist-$2
|
---|
107 | echo -e "\t@extras/farce --directory $OUTPUT $PREDIR $PREFILE $ITEDIR $ITEFILE >>logs/\$@ 2>&1" >> $MKFILE.tmp
|
---|
108 | }
|
---|