aboutsummaryrefslogtreecommitdiff
path: root/Tools/portbuild/scripts/processlogs2
blob: 3fb5948b81ea669bf7f9f5981510fd6087c8eb08 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/sh

of=extras.html.new

# delete .new file if it is more than a day old
find $of -mtime +1 -delete 2>/dev/null

if [ -f $of ]; then exit; fi

if [ -e .stamp -a $(echo $(find . -newer .stamp -type f -name '*.log' 2>/dev/null | wc -l)) = "0" ]; then exit; fi

echo "<html><head><title>List of files and directories that do not match their mtree description</title>" >$of
echo "<h1>List of files and directories that do not match their mtree description</h1>" >>$of
echo "</head><body>" >>$of

touch .stamp

find . -name '*.log' | xargs grep -l '^list of.*file' | sort | sed -e 's/^..//' > .tmp
if [ $(echo $(cat .tmp | wc -l)) = 0 ]; then
  echo "No extra files (yet)" >> $of
else
  set $(cat .tmp)
  num=$#
  if [ -s cvsdone ]; then
    echo "(cvs update finished at: $(cat cvsdone))<br>" >> $of
  fi
  echo "(timestamp of newest log: $(ls -rtTl | grep '\.log$' | tail -1 | awk '{printf("%s %s %s %s\n",$6,$7,$8,$9)}'))<br><br>" >> $of
  echo "<table border=1>" >>$of
  echo "<tr><th>Log</th><th>Aff.</th><th>Size</th><th>Repository</th><th>Maintainer</th><th>Pathname</th></tr>" >>$of
  while [ $# -gt 0 ]; do
    log=$(basename $1 .log)
    echo -n "<tr><td valign=\"top\">" >>$of
    echo -n "<a name=\"$log.log\"></a>" >> $of
    echo -n "<a href=\"$log.log\">" >>$of
    echo -n $log >>$of
    echo -n "</a>" >>$of
    echo -n "</td><td align=right valign=\"top\">" >>$of
    affected=$(($(grep -cF $log < INDEX) - 1))
    if [ $affected != 0 ]; then echo -n $affected >>$of; fi
    echo -n "</td><td align=right valign=\"top\">" >>$of
    size=$(/bin/ls -sk $log.log | awk '{print $1}')
    echo -n "$size KB" >>$of
    echo -n "</td><td valign=\"top\">" >>$of
    dir=$(sed -n -e '4p' $log.log | awk '{print $3}' | sed -e 's,^/[^/]*/[^/]*/,,')
    echo -n "<a href=\"http://www.FreeBSD.org/cgi/cvsweb.cgi/ports/$dir\">$dir</a>" >>$of
    echo -n "</td><td valign=\"top\">" >>$of
    maint=$(sed -n -e '3p' $log.log | awk '{print $3}')
    maints="$maints $maint"
    echo -n "<a href=\"mailto:$maint\">$maint</a>" >>$of
    echo "</td><td valign=\"top\">" >>$of
    cat $log.log | sed -e '1,/^list of extra files and directories/d' -e '/^list of/,$d' | awk '{print $11}' | sed -E -e 's,^,<font color=\"magenta\">,' -e 's,(usr/(local|X11R6)),<font color=\"black\">\1,g' -e 's,$,</font></font><br>,' >>$of
    cat $log.log | sed -e '1,/^list of files present before this port was installed/d' -e '/^list of/,$d' -e 's,^\./,,' | awk '{print $1}' | sed -e 's,^,<font color=\"orange\">,' -e 's,$, (missing)</font><br>,' >> $of
    cat $log.log | sed -e '1,/^list of filesystem changes/d' -e '/^	/d' | awk '{print $1}' | sed -e 's,^,<font color=\"red\">,' -e 's,$, (changed)</font><br>,' >>$of
    echo "</td></tr>" >>$of
    shift
  done
  echo "</table><br>" >> $of
  echo "$num errors<br>" >> $of
fi

rm .tmp

echo "<hr>" >> $of
echo "<a href=\"../\">back to top</a>" >> $of

echo "</body></html>" >>$of

mv -f $of extras.html

echo $maints | sed -e 's/ /\
/g' | sort -fu > maintainers