source: common/libs/func_compare.sh@ a2b5689

ablfs-more legacy trunk
Last change on this file since a2b5689 was f596dde, checked in by Pierre Labastie <pierre@…>, 6 years ago

Get rid of the GPLv2 license:

  • Replace the menu system with the Kconfiglib, which has an ISC license
  • Remove farce and any reference to it
  • Rewrite the copyright notice, add the LICENSE files
  • Adapt Config.in and a few other programs to the new menu system
  • Property mode set to 100644
File size: 2.9 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" ]] ; then
30 final_system_Makefiles $RUN
31 else
32 chapter6_Makefiles $RUN
33 fi
34
35 if [[ "$PROGNAME" = "clfs" ]] ; then
36 basicsystem="$basicsystem $PREV_IT $system_build"
37 else
38 chapter6="$chapter6 $PREV_IT $system_build"
39 fi
40
41 if [[ "$RUN" = "$ITERATIONS" ]] ; then
42 if [[ "$PROGNAME" = "clfs" ]] ; then
43 basicsystem="$basicsystem iteration-$RUN"
44 else
45 chapter6="$chapter6 iteration-$RUN"
46 fi
47 fi
48}
49
50#----------------------------------#
51wrt_compare_work() { #
52#----------------------------------#
53 local ITERATION=$1
54 local PREV_IT=$2
55 local PRUNEPATH="/dev /home /${SCRIPT_ROOT} /lost+found /media /mnt /opt /proc \
56/sources /root /srv /sys /tmp /tools /usr/local /usr/src"
57
58 local ROOT_DIR=/
59 local DEST_TOPDIR=/${SCRIPT_ROOT}
60 local ICALOGDIR=/${SCRIPT_ROOT}/logs/ICA
61
62 if [[ "$RUN_ICA" = "y" ]] ; then
63 local DEST_ICA=$DEST_TOPDIR/ICA && \
64(
65 cat << EOF
66 @extras/do_copy_files "$PRUNEPATH" $ROOT_DIR $DEST_ICA/$ITERATION >>logs/\$@ 2>&1 && \\
67 extras/do_ica_prep $DEST_ICA/$ITERATION >>logs/\$@ 2>&1
68EOF
69) >> $MKFILE.tmp
70 if [[ "$ITERATION" != "iteration-1" ]] ; then
71 wrt_do_ica_work "$PREV_IT" "$ITERATION" "$DEST_ICA"
72 fi
73 fi
74
75}
76
77#----------------------------------#
78wrt_do_ica_work() { #
79#----------------------------------#
80 echo -e "\t@extras/do_ica_work $1 $2 $ICALOGDIR $3 >>logs/\$@ 2>&1" >> $MKFILE.tmp
81}
82
83#----------------------------------#
84wrt_logs() { #
85#----------------------------------#
86 local build=build_$1
87 local file
88
89(
90 cat << EOF
91 @cd logs && \\
92 mkdir $build && \\
93 mv -f `echo ${system_build} | sed 's/ /* /g'`* $build && \\
94 if [ ! $build = build_1 ] ; then \\
95 cd $build && \\
96 for file in \`ls .\` ; do \\
97 mv -f \$\$file \`echo \$\$file | sed -e 's,-$build,,'\` ; \\
98 done ; \\
99 fi ;
100 @cd /\$(SCRIPT_ROOT)
101 @if [ -d test-logs ] ; then \\
102 cd test-logs && \\
103 mkdir $build && \\
104 mv -f `echo ${system_build} | sed 's/ /* /g'`* $build && \\
105 if [ ! $build = build_1 ] ; then \\
106 cd $build && \\
107 for file in \`ls .\` ; do \\
108 mv -f \$\$file \`echo \$\$file | sed -e 's,-$build,,'\` ; \\
109 done ; \\
110 fi ; \\
111 cd /\$(SCRIPT_ROOT) ; \\
112 fi ;
113EOF
114) >> $MKFILE.tmp
115}
Note: See TracBrowser for help on using the repository browser.