source: common/libs/func_compare.sh@ 7214dad

2.3 2.3.x 2.4 ablfs ablfs-more legacy new_features trunk
Last change on this file since 7214dad was daa489d, checked in by Manuel Canales Esparcia <manuel@…>, 18 years ago

Removed unmaintained PACO patch.

  • Property mode set to 100644
File size: 3.8 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 this_script=$ITERATION
14 CHROOT_wrt_target "$ITERATION" "$PREV"
15 wrt_compare_work "$ITERATION" "$PREV_IT"
16 wrt_logs "$N"
17 wrt_touch
18 PREV_IT=$ITERATION
19 PREV=$ITERATION
20 done
21}
22
23#----------------------------------#
24wrt_system_build() { #
25#----------------------------------#
26 local RUN=$1
27 local PREV_IT=$2
28
29 if [[ "$PROGNAME" = "clfs" ]] && [[ "$METHOD" = "chroot" ]] ; then
30 chroot_final_system_Makefiles $RUN
31 elif [[ "$PROGNAME" = "clfs" ]] && [[ "$METHOD" = "boot" ]] ; then
32 boot_final_system_Makefiles $RUN
33 else
34 chapter6_Makefiles $RUN
35 fi
36
37 if [[ "$PROGNAME" = "clfs" ]] ; then
38 basicsystem="$basicsystem $PREV_IT $system_build"
39 else
40 chapter6="$chapter6 $PREV_IT $system_build"
41 fi
42
43 if [[ "$RUN" = "$ITERATIONS" ]] ; then
44 if [[ "$PROGNAME" = "clfs" ]] ; then
45 basicsystem="$basicsystem iteration-$RUN"
46 else
47 chapter6="$chapter6 iteration-$RUN"
48 fi
49 fi
50}
51
52#----------------------------------#
53wrt_compare_work() { #
54#----------------------------------#
55 local ITERATION=$1
56 local PREV_IT=$2
57 local PRUNEPATH="/dev /home /${SCRIPT_ROOT} /lost+found /media /mnt /opt /proc \
58/sources /root /srv /sys /tmp /tools /usr/local /usr/src"
59
60 local ROOT_DIR=/
61 local DEST_TOPDIR=/${SCRIPT_ROOT}
62 local ICALOGDIR=/${SCRIPT_ROOT}/logs/ICA
63 local FARCELOGDIR=/${SCRIPT_ROOT}/logs/farce
64
65 if [[ "$RUN_ICA" = "y" ]] ; then
66 local DEST_ICA=$DEST_TOPDIR/ICA && \
67(
68 cat << EOF
69 @extras/do_copy_files "$PRUNEPATH" $ROOT_DIR $DEST_ICA/$ITERATION >>logs/\$@ 2>&1 && \\
70 extras/do_ica_prep $DEST_ICA/$ITERATION >>logs/\$@ 2>&1
71EOF
72) >> $MKFILE.tmp
73 if [[ "$ITERATION" != "iteration-1" ]] ; then
74 wrt_do_ica_work "$PREV_IT" "$ITERATION" "$DEST_ICA"
75 fi
76 fi
77
78 if [[ "$RUN_FARCE" = "y" ]] ; then
79 local DEST_FARCE=$DEST_TOPDIR/farce && \
80(
81 cat << EOF
82 @extras/do_copy_files "$PRUNEPATH" $ROOT_DIR $DEST_FARCE/$ITERATION >>logs/\$@ 2>&1 && \\
83 extras/filelist $DEST_FARCE/$ITERATION $DEST_FARCE/filelist-$ITERATION >>logs/\$@ 2>&1
84EOF
85) >> $MKFILE.tmp
86 if [[ "$ITERATION" != "iteration-1" ]] ; then
87 wrt_do_farce_work "$PREV_IT" "$ITERATION" "$DEST_FARCE"
88 fi
89 fi
90}
91
92#----------------------------------#
93wrt_do_ica_work() { #
94#----------------------------------#
95 echo -e "\t@extras/do_ica_work $1 $2 $ICALOGDIR $3 >>logs/\$@ 2>&1" >> $MKFILE.tmp
96}
97
98#----------------------------------#
99wrt_do_farce_work() { #
100#----------------------------------#
101 local OUTPUT=$FARCELOGDIR/${1}_V_${2}
102 local PREDIR=$3/$1
103 local PREFILE=$3/filelist-$1
104 local ITEDIR=$3/$2
105 local ITEFILE=$3/filelist-$2
106 echo -e "\t@extras/farce --directory $OUTPUT $PREDIR $PREFILE $ITEDIR $ITEFILE >>logs/\$@ 2>&1" >> $MKFILE.tmp
107}
108
109#----------------------------------#
110wrt_logs() { #
111#----------------------------------#
112 local build=build_$1
113 local file
114
115(
116 cat << EOF
117 @cd logs && \\
118 mkdir $build && \\
119 mv -f ${system_build} $build && \\
120 if [ ! $build = build_1 ] ; then \\
121 cd $build && \\
122 for file in \`ls .\` ; do \\
123 mv -f \$\$file \`echo \$\$file | sed -e 's,-$build,,'\` ; \\
124 done ; \\
125 fi ;
126 @cd /\$(SCRIPT_ROOT)
127 @if [ -d test-logs ] ; then \\
128 cd test-logs && \\
129 mkdir $build && \\
130 mv -f ${system_build} $build && \\
131 if [ ! $build = build_1 ] ; then \\
132 cd $build && \\
133 for file in \`ls .\` ; do \\
134 mv -f \$\$file \`echo \$\$file | sed -e 's,-$build,,'\` ; \\
135 done ; \\
136 fi ; \\
137 cd /\$(SCRIPT_ROOT) ; \\
138 fi ;
139EOF
140) >> $MKFILE.tmp
141}
Note: See TracBrowser for help on using the repository browser.