summaryrefslogtreecommitdiff
path: root/d/sys/lampion/local/bin/update-svnco
blob: a40ef39f657185ce644470068c96833fc382a983 (plain)
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
#!/usr/bin/zsh

export PATH=$PATH:/usr/local/bin

svncodir=/var/data/svnco
readme=README.html

cd $svncodir || exit 1

exec 1> /tmp/update-svnco-output

# Update SVN.

svn up || echo "Error in svn up" >&2
for i in $(scan-svnco make)
do
    make -C $i doc
done
for i in $(scan-svnco txt)
do
    h=${i/.txt/.html}
    if [[ ! -f $h || $i -nt $h ]]; then
	echo "AFT $i"
	if grep -q '^*Title' $i; then
	    aft $i && [[ -f $i-TOC ]] && aft $i
	fi
    fi
    for j in $(sed -ne 's/^*Image[^: ]*: *\(.*\)$/\1/p' < $i)
    do
	img=${i:h}/$j
	echo "IMG $img"
	fig=${img/.png/.fig}
	[[ -r $fig && ( ! -f $img || $fig -nt $img ) ]] && \
	fig2dev -L png $fig $img
    done
done
(cd $svncodir/p/tools && ./todo.pl -f html > todo.html)

exec 1> $readme

cat <<EOF
<pre>Codes :
-------

a : �lectronique analogique.
b : bureau.
d : outils et m�thodes de d�velopement.
i : informatique.
n : �lectronique num�rique.
m : m�canique.
p : gestion de projet.

Documentation r�cente :
-----------------------

EOF
scan-svnco html | \
sed -ne 's|^\./\(.*\)/\([^/]*\.html\)$|<a href="\1/">\1</a>/<a href="\1/\2">\2</a>|p' \
	-e 's|^\./\(.*\)/\([^/]*\)$|<a href="\1/">\1</a>/\2|p'
echo '</pre>'