3 # --- T2-COPYRIGHT-NOTE-BEGIN ---
4 # T2 SDE: scripts/Create-ErrList
5 # Copyright (C) 2004 - 2021 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
37 cut
-d ' ' -f 2- var
/adm
/flists
/$2 |
tac |
while read fn
; do
38 if [ -d "$fn" ]; then rmdir "$fn"
47 config
=$2 ; shift; shift ;;
62 if [ $2 != '!' ]; then
63 repository
=" $2 "; shift; shift
64 while [ "$1" -a -d "package/$1" ]; do
65 repository
="$repository $1 "; shift
68 shift; shift; repository
=""
69 for x
in $
( ls package
/ ); do
70 [ -d "package/$x" ] &&
71 repository
="$repository $x"
73 repository
="$repository "
74 while [ "$1" -a -d "package/$1" ]; do
75 repository
="${repository// $1 / }"; shift
81 stages
="[$2]" ; shift; shift ;;
84 logdir
=$2 ; shift; shift ;;
87 copydir
=$2 ; shift; shift ;;
90 movedir
=$2 ; shift; shift ;;
99 fulldelete
=1 ; shift ;;
102 newdelete
=1 ; shift ;;
105 newremove
=1 ; shift ;;
108 onlyupdated
=1 ; shift ;;
114 x
="${0//?/ }"; x
="${x# }"
115 echo "Usage: $0 [ -cfg config ] [ -repository repository ] \\"
116 echo " $x [ -copydir copydir | -movedir movedir ] [ -repstat ] \\"
117 echo " $x [ -stage stage ] [ -logdir logdir ] [ -remove ] [ -[full]delete -new[remove|delete] \\"
118 echo " $x [ -updated ] [ -showerr ] [ -showtree ] [ -showdepc ] \\"
119 echo " $x [ -dry-run ] [ <package> ]"
127 .
scripts
/parse-config
128 .
scripts
/functions.
in
130 logdir
="${logdir:-build/$SDECFG_ID/var/adm/logs}"
132 if [ "$newdelete" = 1 -o "$newremove" = 1 ]; then
133 while read pkg cksum1
135 cksum2
=$
( pkgchksum package
/*/$pkg/ )
136 if [ "$cksum1" != "$cksum2" ]; then
137 if [ "$newdelete" = 1 ]; then
138 echo "Removing package '$pkg' ..."
139 [ "$dryrun" = "1" ] || uninstall_pkg build
/$SDECFG_ID $pkg
140 [ "$dryrun" = "1" ] ||
rm -f build
/$SDECFG_ID/var
/adm
/*/?
-$pkg.
*
142 echo "Scheduling package '$pkg' for rebuild ..."
143 [ "$dryrun" = "1" ] ||
rm -f build
/$SDECFG_ID/var
/adm
/*/?
-$pkg.
*
147 grep -R '^\(ROCK Linux\|T2\) Package Source Checksum: ' \
148 build
/$SDECFG_ID/var
/adm
/packages
/ |
149 sed 's,.*/\([^:]*\):.*:,\1,'
154 if [ "$repstat" = 1 ]; then
157 echo -e "Repository\tPkg Total\tPkg OK\tPkg Error"
159 total_pkgt
=0; total_pkgo
=0; total_pkge
=0
160 for x
in $
( cd package
; echo [a-z0-9
]* ); do
161 pkgt
=0; pkgo
=0; pkge
=0
162 for y
in $
( cd package
/$x; echo [a-z0-9
]* ); do
163 if [ "$( ls $logdir/$stages-$y.err 2> /dev/null )" ]
164 then (( pkge
++ )); (( total_pkge
++ ))
165 elif [ "$( ls $logdir/$stages-$y.log 2> /dev/null )" ]
166 then (( pkgo
++ )); (( total_pkgo
++ ))
169 (( pkgt
= pkgo
+ pkge
)); (( total_pkgt
+= pkgt
))
170 [ $pkgt != 0 ] && echo -e "$x\t$pkgt\t$pkgo\t$pkge"
173 echo -e "total\t$total_pkgt\t$total_pkgo\t$total_pkge"
176 expand -t20,35,50 |
sed 's,^, ,'
182 if [ "$fulldelete" = 1 ]; then
184 rm -vf "$logdir"/$stages-$x.
{err
,log
,out
}
185 rm -vf "$logdir"/..
/*/$x
187 elif [ "$remove" = 1 ]; then
189 echo "Scheduling package '$x' for rebuild ..."
190 uninstall_pkg build
/$SDECFG_ID $x
191 rm -f build
/$SDECFG_ID/var
/adm
/*/$stages-$x.
{err
,log
,out
}
193 elif [ "$delete" = 1 ]; then
194 for x
; do rm -vf "$logdir"/$stages-$x.
{err
,log
,out
}; done
196 for x
; do less "$logdir"/$stages-$x.err
; done
202 echo "Error logs from $SDECFG_ID:"
203 [ $showerr = 0 ] && echo
209 for stagelevel
in $
( echo "$stages" |
sed 's,[][],,g; s,.,& ,g' ); do
210 while read x x x tree pkg x
; do
212 "${repository/ $tree /}" = "$repository" ] && continue
215 if [ $onlyupdated != 0 ]; then
216 [ "$( bash scripts/xfind.sh package/*/$pkg -newer "$logdir/$stagelevel-$pkg.err
" -o -newer "$logdir/$stagelevel-$pkg.log
" )" ] && this_is_error
=1
217 elif [ -f "$logdir/$stagelevel-$pkg.err" ]; then
221 if [ $this_is_error = 1 ]; then
222 if [ $showerr = 0 ]; then
223 if [ $showdepc != 0 ]; then
224 d
=$
( scripts
/Check-Deps-3
$stagelevel \
225 $pkg config
/$config/packages | \
226 cut
-f3 -d' ' |
sort -u |
wc -l )
227 d
="$( printf " %3d
" $d )"
231 echo "[$stagelevel]$d ${tree:0:13}/${pkg:0:18}"
233 echo; echo "== $stagelevel-$pkg.* =="
234 tail -n 20 "$logdir/$stagelevel-$pkg".
* | \
240 $lines[$#lines+1] = $_;
242 for ($counter=0; $counter <= $#lines; $counter++) {
244 if ( /^checking for .*\.\.\. *Package / ||
245 /configure: error:/ ) {
246 for ($_=1; $_ <= $counter; $_++) {
247 print "$lines[$_]\n";
252 for ($counter=0; $counter <= $#lines; $counter++) {
254 if ( /^(make\S*): / ) {
258 ($_=$lines[$counter++]) ) {
259 last unless /^(make\S*): /;
260 $output="" if $1 ne $makeprefix;
264 print $output; exit 0;
270 ' |
tac |
fold -s -w79
273 for x
in `grep -lwi $3 $logdir/*.err | \
274 sed 's,.*/.-,,; s,\.err,,' | sort -u`
276 [ "$x" = "$3" ] && continue
277 [ "${2/ $x /}" != "$2" ] && continue
278 depcheck
"${1} " "$2 $3 " $x
281 [ $showtree = 1 ] && depcheck
"" "" $pkg
283 if [ "$copydir" ]; then
285 cp "$logdir/$stagelevel-$pkg.err" "$copydir"
287 if [ "$movedir" ]; then
289 mv "$logdir/$stagelevel-$pkg.err" "$movedir"
291 if [ "$fulldelete" -eq 1 ]; then
292 rm -f "$logdir"/$stages-$pkg.
{err
,log
,out
}
293 rm -f "$logdir"/..
/*/$pkg
294 elif [ "$delete" -eq 1 ]; then
295 rm -f "$logdir/$stagelevel-$pkg.err"
298 elif [ -f "$logdir/$stagelevel-$pkg.log" ]; then
302 done < <( grep "^X [0-9-]*$stagelevel" config
/$config/packages
)
304 if [ $showerr = 0 ]; then
305 paste - - |
expand -t40 |
sed 's,^, ,'
311 echo "$count_pkg builds total, $count_log completed fine," \
312 "$count_err with errors, $(( count_pkg - count_log - count_err )) to go."