File: nightly-diffmon

package info (click to toggle)
diffmon 20020222-7
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 232 kB
  • sloc: sh: 1,789; makefile: 31; sed: 21
file content (137 lines) | stat: -rwxr-xr-x 4,973 bytes parent folder | download | duplicates (4)
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#!/bin/sh
#set -xv

###
# # Set script variables
###
WWW_HOME=~www
export WWW_HOME
# read variables used by several scripts
echo "`date`  Sourcing ${WWW_HOME}/bin/nightly-vars"
. ${WWW_HOME}/bin/nightly-vars

###
# # Prepare diffmon files
###
echo "`date`  Making diffmon config file for English HTML files"
#
# 1) Doing this by excluding
#        -name "*_toc.html"
#        -name "*_stoc.html"
#        -name "*_foot.html"
#        -regex ".*_[0-9]+.html"
# is a small kludge, as it assumes there are no manually created
# files with these patterns.  -len tower
#
# If you make a change to this exception list,
# you should consider also changing the list in make.html.TAGS
# They can be (and currently are) different.
#
# 2) Filenames that have colons (":") in them confuse diffmon,
# so we wild card them with the "sed -e 's/:/?/g" lines below.
#
# 3) Without the "sort -u" lines below, there are reports of a file being
# added and deleted in the same diffmon run on a diffmon-web*.cf file.  The
# reason is that `find's output is not sorted.
#
find ${HTMLDIRS} \
    -name "*.html" -type f \
    \
    -a \! -name "*_toc.html" \
    -a \! -name "*_stoc.html" \
    -a \! -name "*_foot.html" \
    -a \! -regex ".*_[0-9]+.html" \
    -a \! -path "/home/www/html/directory/*" \
    \
    -a \! -path "/home/www/html/software/*/*" \
    | sed -e 's/:/?/g' \
    | awk \
      '{ printf "%s : -u : diffmon-web\n",$1 }' \
    | sort -u \
    | sed -f /home/diffmon/diffmon-web.sed \
        > /home/diffmon/diffmon-web.cf
# used WEBLANG here, not TAGSLANG.  the webmasters are responsible for
# the translations for which there are no translation teams. -len tower
for i in $WEBLANG; do
    mv /home/diffmon/diffmon-web.cf /home/diffmon/diffmon-web.cf.IN
    grep -v "\.$i\.html : " \
	< /home/diffmon/diffmon-web.cf.IN \
	> /home/diffmon/diffmon-web.cf
done
rm /home/diffmon/diffmon-web.cf.IN

echo "`date`  Making diffmon config file for translation team:"
echo -n "    "
for i in $WEBLANG; do
    echo -n " $i"
  # Set up for the translated files:
    find ${HTMLDIRS} \
      -name "*.$i.html" -type f \
      -a \! -path "/home/www/html/brave-gnu-world/*" \
      -a \! -path "/home/www/html/server/$i/*" \
      -a \! -path "/home/www/html/software/*/*" \
    | sed -e 's/:/?/g' \
    | sort -u \
    | awk -v LANG=$i \
      '{ printf "%s : -u : diffmon-web-%s-%s\n",$1,LANG,LANG }' \
      > /home/diffmon/diffmon-web-$i-$i.cf
  # Now set up for the English originals that are translated:
  # NOTE: Some files are not translations, they are originals written in
  # that language (e.g. some under /home/www/html/fsfe/), and
  # English translations of them may not exist.   In these cases, 
  # errors will be sent to diffmon-web-errors on those non-existant files.
  # An addition to this script to delete such files from
  # /home/diffmon/diffmon-web-$i.cf  would make monitoring the mail sent to
  # diffmon-web-errors easier.  A file containing the files to delete would
  # be the best way to go, as it means a deliberate decision has been
  # made to not monitor a file.  -tower
    sed -e "s/$i\.html : /html : /" \
        -e "s/diffmon-web-$i-$i/diffmon-web-$i/" \
      < /home/diffmon/diffmon-web-$i-$i.cf \
      > /home/diffmon/diffmon-web-$i.cf
  # Now add the webmaster guideline diffmons
    cat >> /home/diffmon/diffmon-web-$i.cf <<EOF
/home/www/html/server/fsf-html-style-sheet.html : -u : web-translators-$i
EOF
    find /home/www/html/server/standards/ \
	-name "*.html" -type f \
	-printf "%p : -u : web-translators-$i\n" \
    >> /home/diffmon/diffmon-web-$i.cf
done
echo " "

###
# # Run diffmon
###
echo "`date`  Running diffmon for translation team:"
echo -n "    "
for i in $WEBLANG; do
    echo -n " $i"
  # ran with the -n flag - this is a local change to diffmon that
  # prevents cache updates
    /home/diffmon/diffmon -c diffmon-web-$i.cf -e diffmon-web-$i-errors -o /home/diffmon/old_file_dir -p /home/diffmon -n
  # let the e-mail queue empty (to keep web server response reasonable):
    sleep 120
    /home/diffmon/diffmon -c diffmon-web-$i-$i.cf -e diffmon-web-$i-$i-errors -o /home/diffmon/old_file_dir -p /home/diffmon
  # let the e-mail queue empty (to keep web server response reasonable):
    sleep 120
done
echo " "

echo "`date`  Running diffmon for English HTML files"
/home/diffmon/diffmon -c diffmon-web.cf -e diffmon-web-errors -o /home/diffmon/old_file_dir -p /home/diffmon
# let the e-mail queue empty (to keep web server response reasonable):
sleep 120

echo "`date`  Running main diffmon"
/home/diffmon/diffmon -c diffmon.cf -e diffmon-www-errors -o /home/diffmon/old_file_dir -p /home/diffmon
# let the e-mail queue empty (to keep web server response reasonable):
sleep 120

# this compile-command lets you syntax check the script.  -len
#
# local variables:
# eval: (make-local-variable 'compile-command)
# eval: (setq compile-command (concat "/bin/sh -n " buffer-file-name))
# quote-region-quote: "# "
# end: