source: common/func_compare.sh@ 944d69d

experimental
Last change on this file since 944d69d was 34cabf6, checked in by Manuel Canales Esparcia <manuel@…>, 19 years ago

Creating iteration-N.log files to keep clean Makefile output.

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