experimental
Last change
on this file since e65a92f was 11869f1, checked in by Manuel Canales Esparcia <manuel@…>, 19 years ago |
func_ICA.sh clean-up.
|
-
Property mode
set to
100644
|
File size:
1.4 KB
|
Line | |
---|
1 | # $Id$
|
---|
2 |
|
---|
3 | #----------------------------------#
|
---|
4 | wrt_ica_targets() { #
|
---|
5 | #----------------------------------#
|
---|
6 | local ICA_rebuild=$1
|
---|
7 | wrt_ica_rebuild "$ICA_rebuild"
|
---|
8 | wrt_iterations "$ICA_rebuild"
|
---|
9 | }
|
---|
10 |
|
---|
11 | #----------------------------------#
|
---|
12 | wrt_ica_rebuild() { #
|
---|
13 | #----------------------------------#
|
---|
14 | local ICA_rebuild=$1
|
---|
15 | (
|
---|
16 | cat << EOF
|
---|
17 | ICA_rebuild: $ICA_rebuild
|
---|
18 |
|
---|
19 | EOF
|
---|
20 | ) >> $MKFILE
|
---|
21 | }
|
---|
22 |
|
---|
23 | #----------------------------------#
|
---|
24 | wrt_iterations() { #
|
---|
25 | #----------------------------------#
|
---|
26 | local ICA_rebuild=$1
|
---|
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 && \\
|
---|
38 | mv $ICA_rebuild $ITERATION && \\
|
---|
39 | popd
|
---|
40 | @rm -f $ICA_rebuild
|
---|
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 && \\
|
---|
53 | cp $ICA_rebuild iteration-last && \\
|
---|
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 && \\
|
---|
67 | mv $ICA_rebuild $ITERATION && \\
|
---|
68 | popd
|
---|
69 | @rm -f $ICA_rebuild
|
---|
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.