source: common/libs/func_compare.sh@ 9f89fae

ablfs-more trunk
Last change on this file since 9f89fae was 0fa52f2, checked in by Pierre Labastie <pierre.labastie@…>, 3 years ago

Remove legacy: Remove almost all occurrences of CLFS/clfs

  • Property mode set to 100644
File size: 3.1 KB
Line 
1#----------------------------------#
2wrt_compare_targets() { #
3#----------------------------------#
4
5 for ((N=1; N <= ITERATIONS ; N++)) ; do # Double parentheses,
6 # and "ITERATIONS" with no "$".
7 ITERATION=iteration-$N
8 if [ "$N" != "1" ] ; then
9 wrt_system_build "$1" "$N" "$PREV_IT"
10 fi
11 # add needed Makefile target
12 this_script=$ITERATION
13 CHROOT_wrt_target "$ITERATION" "$PREV"
14 wrt_compare_work "$ITERATION" "$PREV_IT"
15 wrt_logs "$N"
16 wrt_touch
17 PREV_IT=$ITERATION
18 PREV=$ITERATION
19 done
20 # We need to prevent "userdel" in all iterations but the last
21 # We need to access the scriptlets in "dir"
22 local dir
23 printf -v dir chapter%02d "$1"
24
25 sed -i '/userdel/d' $dir/*revised*
26 for (( N = 2; N < ITERATIONS; N++ )); do
27 sed -i '/userdel/d' $dir-build_$N/*revised*
28 done
29
30}
31
32#----------------------------------#
33wrt_system_build() { #
34#----------------------------------#
35 local CHAP=$1
36 local RUN=$2
37 local PREV_IT=$3
38
39 chapter_targets $CHAP $RUN
40
41 CHROOT_TGT="$CHROOT_TGT $PREV_IT $system_build"
42
43 if [[ "$RUN" = "$ITERATIONS" ]] ; then
44 CHROOT_TGT="$CHROOT_TGT iteration-$RUN"
45 fi
46}
47
48#----------------------------------#
49wrt_compare_work() { #
50#----------------------------------#
51 local ITERATION=$1
52 local PREV_IT=$2
53 local PRUNEPATH="/dev /home /${SCRIPT_ROOT} /lost+found /media /mnt /opt /proc \
54/sources /root /run /srv /sys /tmp /tools /usr/local /usr/src /var"
55
56 local ROOT_DIR=/
57 local DEST_TOPDIR=/${SCRIPT_ROOT}
58 local ICALOGDIR=/${SCRIPT_ROOT}/logs/ICA
59
60 if [[ "$RUN_ICA" = "y" ]] ; then
61 local DEST_ICA=$DEST_TOPDIR/ICA && \
62 # the PRUNEPATH additional setting is to avoid .pyc files to show up in diff
63(
64 cat << EOF
65 @PRUNEPATH="$PRUNEPATH \$\$(find /usr/lib -name __pycache__)"; \\
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#----------------------------------#
77wrt_do_ica_work() { #
78#----------------------------------#
79 echo -e "\t@extras/do_ica_work $1 $2 $ICALOGDIR $3 >>logs/\$@ 2>&1" >> $MKFILE.tmp
80}
81
82#----------------------------------#
83wrt_logs() { #
84#----------------------------------#
85 local build=build_$1
86 local file
87
88(
89 cat << EOF
90 @cd logs && \\
91 mkdir $build && \\
92 mv -f `echo ${system_build} | sed 's/ /* /g'`* $build && \\
93 if [ ! $build = build_1 ] ; then \\
94 cd $build && \\
95 for file in \`ls .\` ; do \\
96 mv -f \$\$file \`echo \$\$file | sed -e 's,-$build,,'\` ; \\
97 done ; \\
98 fi
99 @cd /\$(SCRIPT_ROOT)
100 @if [ -d test-logs ] ; then \\
101 cd test-logs && \\
102 mkdir $build && \\
103 mv -f `echo ${system_build} | sed 's/ /* /g'`* $build && \\
104 if [ ! $build = build_1 ] ; then \\
105 cd $build && \\
106 for file in \`ls .\` ; do \\
107 mv -f \$\$file \`echo \$\$file | sed -e 's,-$build,,'\` ; \\
108 done ; \\
109 fi ; \\
110 cd /\$(SCRIPT_ROOT) ; \\
111 fi ;
112EOF
113) >> $MKFILE.tmp
114}
Note: See TracBrowser for help on using the repository browser.