source: common/func_compare.sh@ d80021c3

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

Creating raw system_build_N packages targets.

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