-
Notifications
You must be signed in to change notification settings - Fork 29
/
update-pearweb-manuals
executable file
·48 lines (39 loc) · 1.16 KB
/
update-pearweb-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
#!/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/peardoc
dow=`date +"%w"`
len=`echo $BASE | wc -c`
len=`expr $len + 1`
if [ -z "$1" -o "$1" == "-f" ]; then
if [ "$dow" -ne 0 -a "$1" != "-f" ]; then
pred="-mtime 1"
else
pred="-maxdepth 1 -type d"
fi
# for a in `find $BASE $pred | cut -c 23- | sed -e 's:/.*$::' | sort | uniq`; do
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 peardoc: $do" [email protected]
for a in $do; do
mkdir -p /local/mirrors/pearweb/public_html/manual/$a
/local/systems/build-pear-manual /local/mirrors/peardoc \
/local/mirrors/pearweb/public_html/manual/$a $a $TMPDIR/build-pear-$a \
/local/mirrors/pearweb/public_html/distributions/manual \
> $TMPDIR/build-pear-$a.log 2>&1
mv $TMPDIR/build-pear-$a.log /local/mirrors/pearweb/public_html/manual/$a/build.log
rm -rf $TMPDIR/build-pear-$a
done