source: common/func_compare.sh@ 728955b

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

Merged r3043:3145 from experimental:
New Makefile code and other improvements.

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