source: common/libs/func_compare.sh@ 53e258f

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

More compare and related fixes.
Test build in progress.

  • Property mode set to 100644
File size: 3.9 KB
RevLine 
[45f82718]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
[045b2dc]14 CHROOT_wrt_target "$ITERATION" "$PREV"
[45f82718]15 wrt_compare_work "$ITERATION" "$PREV_IT"
[10c8b78]16 wrt_logs "$N"
[6bb080e]17 wrt_touch
[45f82718]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
[045b2dc]30 chroot_final_system_Makefiles $RUN
[45f82718]31 elif [[ "$PROGNAME" = "clfs" ]] && [[ "$METHOD" = "boot" ]] ; then
[045b2dc]32 boot_final_system_Makefiles $RUN
[45f82718]33 else
34 chapter6_Makefiles $RUN
35 fi
36
[045b2dc]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
[45f82718]50}
51
52#----------------------------------#
53wrt_compare_work() { #
54#----------------------------------#
55 local ITERATION=$1
56 local PREV_IT=$2
[1a1f099]57 local PRUNEPATH="/dev /home /${SCRIPT_ROOT} /lost+found /media /mnt /opt /proc \
[45f82718]58/sources /root /srv /sys /tmp /tools /usr/local /usr/src /var/log/paco"
59
[045b2dc]60 local ROOT_DIR=/
61 local DEST_TOPDIR=/${SCRIPT_ROOT}
62 local ICALOGDIR=/${SCRIPT_ROOT}/logs/ICA
63 local FARCELOGDIR=/${SCRIPT_ROOT}/logs/farce
[45f82718]64
[401f81e]65 if [[ "$RUN_ICA" = "y" ]] ; then
[45f82718]66 local DEST_ICA=$DEST_TOPDIR/ICA && \
67(
68 cat << EOF
[6bb080e]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
[45f82718]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
[401f81e]78 if [[ "$RUN_FARCE" = "y" ]] ; then
[45f82718]79 local DEST_FARCE=$DEST_TOPDIR/farce && \
80(
81 cat << EOF
[6bb080e]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
[45f82718]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#----------------------------------#
[6bb080e]95 echo -e "\t@extras/do_ica_work $1 $2 $ICALOGDIR $3 >>logs/\$@ 2>&1" >> $MKFILE.tmp
[45f82718]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
[6bb080e]106 echo -e "\t@extras/farce --directory $OUTPUT $PREDIR $PREFILE $ITEDIR $ITEFILE >>logs/\$@ 2>&1" >> $MKFILE.tmp
[45f82718]107}
[10c8b78]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.