source: common/func_compare.sh@ 0167dd8

experimental
Last change on this file since 0167dd8 was 50fb011, checked in by George Boudreau <georgeb@…>, 18 years ago

First commit of changes to makefile generation. Makefile now does recursive calls to itself for the different phases..SETUP,LUSER,CHROOT,ROOT

  • Property mode set to 100644
File size: 3.5 KB
RevLine 
[1b9148c]1# $Id$
2
[a5fa1a9]3#----------------------------------#
[d27c9ca]4wrt_compare_targets() { #
[bfbd927]5#----------------------------------#
6
7 for ((N=1; N <= ITERATIONS ; N++)) ; do # Double parentheses,
8 # and "ITERATIONS" with no "$".
[6794fe4]9 ITERATION=iteration-$N
[d27c9ca]10 if [ "$N" != "1" ] ; then
[aa08925]11 wrt_system_build "$N" "$PREV_IT"
[6794fe4]12 fi
[4edbc92]13 this_script=$ITERATION
[50fb011]14 CHROOT_wrt_target "$ITERATION" "$PREV"
[d27c9ca]15 wrt_compare_work "$ITERATION" "$PREV_IT"
16 wrt_logs "$N"
17 PREV_IT=$ITERATION
[eb024db]18 PREV=$ITERATION
[6794fe4]19 done
20}
21
22#----------------------------------#
[eb024db]23wrt_system_build() { #
24#----------------------------------#
[aa08925]25 local RUN=$1
26 local PREV_IT=$2
[d80021c3]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
[aa08925]36 echo -e "\nsystem_build_$RUN: $PREV_IT $system_build" >> $MKFILE.tmp
[eb024db]37}
38
39#----------------------------------#
[d27c9ca]40wrt_compare_work() { #
[6794fe4]41#----------------------------------#
42 local ITERATION=$1
[d27c9ca]43 local PREV_IT=$2
[460ea63]44 local PRUNEPATH="/dev /home /${SCRIPT_ROOT} /lost+found /media /mnt /opt /proc \
[5112239]45/sources /root /srv /sys /tmp /tools /usr/local /usr/src /var/log/paco"
[6794fe4]46
[aab6e73]47 if [[ "$PROGNAME" = "clfs" ]] && [[ "$METHOD" = "boot" ]] ; then
[8ba8df4]48 local ROOT_DIR=/
[460ea63]49 local DEST_TOPDIR=/${SCRIPT_ROOT}
50 local ICALOGDIR=/${SCRIPT_ROOT}/logs/ICA
51 local FARCELOGDIR=/${SCRIPT_ROOT}/logs/farce
[6794fe4]52 else
[8ba8df4]53 local ROOT_DIR=$BUILDDIR
[460ea63]54 local DEST_TOPDIR=$BUILDDIR/${SCRIPT_ROOT}
[6794fe4]55 fi
56
[47fddc8]57 if [[ "$RUN_ICA" = "y" ]] ; then
[6794fe4]58 local DEST_ICA=$DEST_TOPDIR/ICA && \
[bfbd927]59(
60 cat << EOF
[34cabf6]61 @extras/do_copy_files "$PRUNEPATH" $ROOT_DIR $DEST_ICA/$ITERATION >>logs/$ITERATION.log 2>&1 && \\
62 extras/do_ica_prep $DEST_ICA/$ITERATION >>logs/$ITERATION.log 2>&1
[bfbd927]63EOF
[d27c9ca]64) >> $MKFILE.tmp
[8ba8df4]65 if [[ "$ITERATION" != "iteration-1" ]] ; then
[d27c9ca]66 wrt_do_ica_work "$PREV_IT" "$ITERATION" "$DEST_ICA"
[8ba8df4]67 fi
[6794fe4]68 fi
69
[47fddc8]70 if [[ "$RUN_FARCE" = "y" ]] ; then
[6794fe4]71 local DEST_FARCE=$DEST_TOPDIR/farce && \
[bfbd927]72(
73 cat << EOF
[34cabf6]74 @extras/do_copy_files "$PRUNEPATH" $ROOT_DIR $DEST_FARCE/$ITERATION >>logs/$ITERATION.log 2>&1 && \\
75 extras/filelist $DEST_FARCE/$ITERATION $DEST_FARCE/filelist-$ITERATION >>logs/$ITERATION.log 2>&1
[bfbd927]76EOF
[d27c9ca]77) >> $MKFILE.tmp
[8ba8df4]78 if [[ "$ITERATION" != "iteration-1" ]] ; then
[d27c9ca]79 wrt_do_farce_work "$PREV_IT" "$ITERATION" "$DEST_FARCE"
[8ba8df4]80 fi
[6794fe4]81 fi
82}
83
[8ba8df4]84#----------------------------------#
85wrt_do_ica_work() { #
86#----------------------------------#
[34cabf6]87 echo -e "\t@extras/do_ica_work $1 $2 $ICALOGDIR $3 >>logs/$ITERATION.log 2>&1" >> $MKFILE.tmp
[8ba8df4]88}
89
90#----------------------------------#
[d27c9ca]91wrt_do_farce_work() { #
[8ba8df4]92#----------------------------------#
93 local OUTPUT=$FARCELOGDIR/${1}_V_${2}
94 local PREDIR=$3/$1
[34cabf6]95 local PREFILE=$3/filelist-$1
[8ba8df4]96 local ITEDIR=$3/$2
[34cabf6]97 local ITEFILE=$3/filelist-$2
98 echo -e "\t@extras/farce --directory $OUTPUT $PREDIR $PREFILE $ITEDIR $ITEFILE >>logs/$ITERATION.log 2>&1" >> $MKFILE.tmp
[6794fe4]99}
[bfbd927]100
[6794fe4]101#----------------------------------#
[9199a13]102wrt_logs() { #
[6794fe4]103#----------------------------------#
[34cabf6]104 local ITERATION=iteration-$1
[6794fe4]105
106(
107 cat << EOF
[34cabf6]108 @pushd logs 1> /dev/null && \\
[6794fe4]109 mkdir $ITERATION && \\
[4edbc92]110 mv ${LOGS} $ITERATION && \\
[34cabf6]111 popd 1> /dev/null
[9199a13]112 @touch \$@ && \\
[3b63c8c]113 sleep .25 && \\
[9199a13]114 echo " "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
115 echo --------------------------------------------------------------------------------\$(WHITE)
[bfbd927]116EOF
[d27c9ca]117) >> $MKFILE.tmp
[bfbd927]118}
Note: See TracBrowser for help on using the repository browser.