-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathupdate-phpweb-manuals
executable file
·51 lines (42 loc) · 1.19 KB
/
update-phpweb-manuals
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
#!/bin/sh
# lynx is dumb.
TERM=vt100
export TERM
# this rebuilds all of the manuals on sunday, or just the ones
# that have changed in the last day on other days
TMPDIR=/local/tmp
BASE=/local/mirrors/phpdoc
dow=`date +"%w"`
len=`echo $BASE | wc -c`
len=`expr $len + 1`
if [ -z "$1" -o "$1" == "-f" ]; then
if [ "$dow" -ne 5 -a "$1" != "-f" ]; then
pred="-mtime 1"
else
pred="-maxdepth 1 -type d"
fi
for a in `find $BASE $pred | cut -c $len- | sort | uniq`; do
if [ -f $BASE/$a/language-defs.ent ]; then
do="$do $a"
fi
done
else
do="$@"
fi
if test -z "$do"; then
exit
fi
echo $do | mail -s "rebuilding phpdoc: $do" [email protected]
for a in $do; do
if [ -d /local/mirrors/phpdoc/$a ]; then
mkdir -p /local/mirrors/phpweb/manual/$a
/local/systems/build-manual /local/mirrors/phpdoc \
/local/mirrors/phpweb/manual/$a $a $TMPDIR/build-$a \
/local/mirrors/phpweb/distributions/manual \
> $TMPDIR/build-$a.log 2>&1
grep -v '^Warning: Unknown character' $TMPDIR/build-$a.log | \
gzip -c -9 > /local/mirrors/phpweb/manual/$a/build.log.gz
rm -f /local/mirrors/phpweb/manual/$a/build.log
rm -rf $TMPDIR/build-$a $TMPDIR/build-$a.log
fi
done