3 # --- T2-COPYRIGHT-NOTE-BEGIN ---
4 # T2 SDE: scripts/Create-ErrList
5 # Copyright (C) 2004 - 2023 The T2 SDE Project
6 # Copyright (C) 1998 - 2003 ROCK Linux Project
8 # This Copyright note is generated by scripts/Create-CopyPatch,
9 # more information can be found in the files COPYING and README.
11 # This program is free software; you can redistribute it and/or modify
12 # it under the terms of the GNU General Public License version 2.
13 # --- T2-COPYRIGHT-NOTE-END ---
33 # uninstall sysroot package
36 cut
-d ' ' -f 2- var
/adm
/flists
/$2 |
tac |
while read fn
; do
37 if [ -d "$fn" ]; then rmdir "$fn"
46 config
=$2 ; shift; shift ;;
61 if [ $2 != '!' ]; then
62 repository
=" $2 "; shift; shift
63 while [ "$1" -a -d "package/$1" ]; do
64 repository
="$repository $1 "; shift
67 shift; shift; repository
=""
68 for x
in $
(ls package
/); do
69 [ -d "package/$x" ] &&
70 repository
="$repository $x"
72 repository
="$repository "
73 while [ "$1" -a -d "package/$1" ]; do
74 repository
="${repository// $1 / }"; shift
80 stages
="[$2]" ; shift; shift ;;
83 logdir
=$2 ; shift; shift ;;
86 copydir
=$2 ; shift; shift ;;
89 movedir
=$2 ; shift; shift ;;
98 fulldelete
=1 ; shift ;;
101 newdelete
=1 ; shift ;;
103 -newresched|
-newreschedule)
104 newresched
=1 ; shift ;;
107 onlyupdated
=1 ; shift ;;
113 x
="${0//?/ }" x
="${x# }"
114 echo "Usage: $0 [ -cfg config ] [ -repository repository ] \\"
115 echo " $x [ -copydir copydir | -movedir movedir ] [ -repstat ] \\"
116 echo " $x [ -stage stage ] [ -logdir logdir ] [ -remove ] [ -[full]delete -new[delete|resched] \\"
117 echo " $x [ -updated ] [ -showerr ] [ -showtree ] [ -showdepc ] \\"
118 echo " $x [ -dry-run ] [ <package> ]"
126 .
scripts
/parse-config
127 .
scripts
/functions.
in
129 logdir
="${logdir:-build/$SDECFG_ID/var/adm/logs}"
131 if [ "$newdelete" = 1 -o "$newresched" = 1 ]; then
132 while read pkg cksum1
; do
133 cksum2
=$
(pkgchksum package
/*/$pkg/)
134 if [ "$cksum1" != "$cksum2" ]; then
135 if [ "$newdelete" = 1 ]; then
136 echo "Removing package '$pkg' ..."
137 [ "$dryrun" = "1" ] || uninstall_pkg build
/$SDECFG_ID $pkg
138 [ "$dryrun" = "1" ] ||
rm -f build
/$SDECFG_ID/var
/adm
/*/?
-$pkg.
*
140 echo "Scheduling package '$pkg' for rebuild ..."
141 [ "$dryrun" = "1" ] ||
rm -f build
/$SDECFG_ID/var
/adm
/*/?
-$pkg.
*
145 grep -R '^\(ROCK Linux\|T2\) Package Source Checksum: ' \
146 build
/$SDECFG_ID/var
/adm
/packages
/ |
147 sed 's,.*/\([^:]*\):.*:,\1,'
152 if [ "$repstat" = 1 ]; then
155 echo -e "Repository\tPkg Total\tPkg OK\tPkg Error"
157 total_pkgt
=0 total_pkgo
=0 total_pkge
=0
158 for x
in $
(cd package
; echo [a-z0-9
]*); do
160 for y
in $
(cd package
/$x; echo [a-z0-9
]*); do
161 if [ "$(ls $logdir/$stages-$y.err 2> /dev/null)" ]
162 then ((pkge
++)); ((total_pkge
++))
163 elif [ "$(ls $logdir/$stages-$y.log 2> /dev/null)" ]
164 then ((pkgo
++)); ((total_pkgo
++))
167 ((pkgt
= pkgo
+ pkge
)); ((total_pkgt
+= pkgt
))
168 [ $pkgt != 0 ] && echo -e "$x\t$pkgt\t$pkgo\t$pkge"
171 echo -e "total\t$total_pkgt\t$total_pkgo\t$total_pkge"
174 expand -t20,35,50 |
sed 's,^, ,'
180 if [ "$fulldelete" = 1 ]; then
182 rm -vf "$logdir"/$stages-$x.
{err
,log
,out
}
183 rm -vf "$logdir"/..
/*/$x
185 elif [ "$remove" = 1 ]; then
187 echo "Scheduling package '$x' for rebuild ..."
188 uninstall_pkg build
/$SDECFG_ID $x
189 rm -f build
/$SDECFG_ID/var
/adm
/*/$stages-$x.
{err
,log
,out
}
191 elif [ "$delete" = 1 ]; then
192 for x
; do rm -vf "$logdir"/$stages-$x.
{err
,log
,out
}; done
194 for x
; do less "$logdir"/$stages-$x.err
; done
200 echo "Error logs from $SDECFG_ID:"
201 [ $showerr = 0 ] && echo
207 for stagelevel
in $
(echo "$stages" |
sed 's,[][],,g; s,.,& ,g'); do
208 while read x x x tree pkg x
; do
210 "${repository/ $tree /}" = "$repository" ] && continue
213 if [ $onlyupdated != 0 ]; then
214 [ "$(bash scripts/xfind.sh package/*/$pkg -newer "$logdir/$stagelevel-$pkg.err
" -o -newer "$logdir/$stagelevel-$pkg.log
")" ] && this_is_error
=1
215 elif [ -f "$logdir/$stagelevel-$pkg.err" ]; then
219 if [ $this_is_error = 1 ]; then
220 if [ $showerr = 0 ]; then
221 if [ $showdepc != 0 ]; then
222 d
=$
(scripts
/Check-Deps-3
$stagelevel \
223 $pkg config
/$config/packages |
224 cut
-f3 -d' ' |
sort -u |
wc -l)
225 d
="$(printf " %3d
" $d)"
229 echo "[$stagelevel]$d ${tree:0:13}/${pkg:0:18}"
231 echo; echo "== $stagelevel-$pkg.* =="
232 tail -n 20 "$logdir/$stagelevel-$pkg".
* |
238 $lines[$#lines+1] = $_;
240 for ($counter=0; $counter <= $#lines; $counter++) {
242 if (/^checking for .*\.\.\. *Package / ||
243 /configure: error:/) {
244 for ($_=1; $_ <= $counter; $_++) {
245 print "$lines[$_]\n";
250 for ($counter=0; $counter <= $#lines; $counter++) {
252 if (/^(make\S*): /) {
256 ($_=$lines[$counter++])) {
257 last unless /^(make\S*): /;
258 $output="" if $1 ne $makeprefix;
262 print $output; exit 0;
268 ' |
tac |
fold -s -w79
271 for x
in `grep -lwi $3 $logdir/*.err |
272 sed 's,.*/.-,,; s,\.err,,' | sort -u`
274 [ "$x" = "$3" ] && continue
275 [ "${2/ $x /}" != "$2" ] && continue
276 depcheck
"${1} " "$2 $3 " $x
279 [ $showtree = 1 ] && depcheck
"" "" $pkg
281 if [ "$copydir" ]; then
283 cp "$logdir/$stagelevel-$pkg.err" "$copydir"
285 if [ "$movedir" ]; then
287 mv "$logdir/$stagelevel-$pkg.err" "$movedir"
289 if [ "$fulldelete" -eq 1 ]; then
290 rm -f "$logdir"/$stages-$pkg.
{err
,log
,out
}
291 rm -f "$logdir"/..
/*/$pkg
292 elif [ "$delete" -eq 1 ]; then
293 rm -f "$logdir/$stagelevel-$pkg.err"
296 elif [ -f "$logdir/$stagelevel-$pkg.log" ]; then
300 done < <(grep "^X [0-9-]*$stagelevel" config
/$config/packages
)
302 if [ $showerr = 0 ]; then
303 paste - - |
expand -t40 |
sed 's,^, ,'
309 echo "$count_pkg builds total, $count_log completed fine," \
310 "$count_err with errors, $((count_pkg - count_log - count_err)) to go."