source:
common/func_ICA.sh@
cc020f4
Last change on this file since cc020f4 was fb68d23, checked in by , 19 years ago | |
---|---|
|
|
File size: 1.4 KB |
Rev | Line | |
---|---|---|
[1b9148c] | 1 | # $Id$ |
2 | ||
[a5fa1a9] | 3 | #----------------------------------# |
4 | wrt_ica_targets() { # | |
[bfbd927] | 5 | #----------------------------------# |
[fb68d23] | 6 | local system_rebuild=$1 |
7 | wrt_system_rebuild "$system_rebuild" | |
8 | wrt_iterations "$system_rebuild" | |
[bfbd927] | 9 | } |
10 | ||
11 | #----------------------------------# | |
[fb68d23] | 12 | wrt_system_rebuild() { # |
[a5fa1a9] | 13 | #----------------------------------# |
[fb68d23] | 14 | local system_rebuild=$1 |
[a5fa1a9] | 15 | ( |
16 | cat << EOF | |
[fb68d23] | 17 | system_rebuild: $system_rebuild |
[a5fa1a9] | 18 | |
19 | EOF | |
20 | ) >> $MKFILE | |
21 | } | |
22 | ||
[bfbd927] | 23 | #----------------------------------# |
24 | wrt_iterations() { # | |
25 | #----------------------------------# | |
[fb68d23] | 26 | local system_rebuild=$1 |
[bfbd927] | 27 | |
28 | for ((N=1; N <= ITERATIONS ; N++)) ; do # Double parentheses, | |
29 | # and "ITERATIONS" with no "$". | |
30 | ITERATION=iteration-$N | |
31 | if [ "$N" = "1" ] ; then | |
32 | ( | |
33 | cat << EOF | |
34 | $ITERATION: chapter06 | |
35 | @do_ica_prep | |
36 | @pushd logs && \\ | |
37 | mkdir $ITERATION && \\ | |
[fb68d23] | 38 | mv $system_rebuild $ITERATION && \\ |
[bfbd927] | 39 | popd |
[fb68d23] | 40 | @rm -f $system_rebuild |
[bfbd927] | 41 | @touch \$@ |
42 | ||
43 | EOF | |
44 | ) >> $MKFILE | |
45 | PREV=$ITERATION | |
46 | elif [ "$N" = "$ITERATIONS" ] ; then | |
47 | ( | |
48 | cat << EOF | |
49 | iteration-last: $PREV ICA_rebuild | |
50 | @do_ica_prep | |
51 | @pushd logs && \\ | |
52 | mkdir iteration-last && \\ | |
[fb68d23] | 53 | cp $system_rebuild iteration-last && \\ |
[bfbd927] | 54 | popd |
55 | @do_ica_work | |
56 | @touch \$@ | |
57 | ||
58 | EOF | |
59 | ) >> $MKFILE | |
60 | else | |
61 | ( | |
62 | cat << EOF | |
63 | $ITERATION: $PREV ICA_rebuild | |
64 | @do_ica_prep | |
65 | @pushd logs && \\ | |
66 | mkdir $ITERATION && \\ | |
[fb68d23] | 67 | mv $system_rebuild $ITERATION && \\ |
[bfbd927] | 68 | popd |
[fb68d23] | 69 | @rm -f $system_rebuild |
[bfbd927] | 70 | @touch \$@ |
71 | ||
72 | EOF | |
73 | ) >> $MKFILE | |
74 | PREV=$ITERATION | |
75 | fi | |
76 | done | |
77 | } |
Note:
See TracBrowser
for help on using the repository browser.