1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-24 10:39:57 +01:00
gnupg/scripts/mkwebpage

106 lines
2.3 KiB
Plaintext
Raw Normal View History

#!/bin/sh
# Make a snapshot of the CVS head revision for the gnupg webpages
set -e
1999-05-23 17:29:35 +00:00
cd $HOME/pub
1999-05-23 17:17:09 +00:00
extract_date () {
# This strange construct is to speed up things. Grouping a "s" and a "q"
# does not work. Anyway we should use awk instead.
1999-05-23 17:41:43 +00:00
# Have to quote the I from $Id so that CVS does not expand it
sed '/^.*\$[I]d:.*\$.*$/q' $1 |
sed -n 's!^.*\$[I]d: [^ ]\+ [^ ]\+ \([0-9]*\)/\([0-9]*\)/\([0-9]*\) [^ ]\+ \([^ ]\+\).*$!\1-\2-\3 \4!p'
}
1999-05-23 17:17:09 +00:00
# We have to edit most files
sed_it () {
src=$1
dst=$2
for srcdir in `find $src -type d -print` ; do
dstdir=`echo "$srcdir" | sed "s/^$src/$dst/g"`
mkdir $dstdir || true
for sf in `find $srcdir -type f -maxdepth 1 -print`; do
updated=`extract_date $sf`
df="$dstdir/`basename $sf`"
case "$df" in
*.html)
sed "/@FOOTER@/ {
r $src/footer.html.inc
d
}
/^<body>$/ {
r $src/body-tag.html.inc
d
}
/@UPDATED@/c\\
Updated: $updated \\
<hr>
/@INSERT_BUGLIST_HERE@/ {
r $src/BUGS
d
}
1999-07-24 09:59:06 +00:00
/@HOSTEDBY@/ {
r $src/hostedby.html.inc
d
}
1999-05-23 17:17:09 +00:00
" $sf > $df
;;
*.html.inc | *~ | *.tmp | */BUGS )
:
;;
*)
cat $sf > $df
;;
esac
done
done
}
do_export () {
pgm=$1
mod=$2
1999-05-23 17:17:09 +00:00
rm -rf $pgm.tmp 2>/dev/null || true
rm -rf $pgm.new || true
rm -rf $pgm.old || true
1999-05-23 17:17:09 +00:00
cvs -Q export -r HEAD -d $pgm.tmp $mod
cat <<EOF >$pgm.tmp/NEWS
[ This is a snapshot of the NEWS file from the CVS head revision.
You will find the NEWS for the latest revision below the line
"Noteworthy changes in version 0.x.y".
(wk $(date +%Y-%m-%d)) ]
EOF
cvs -Q checkout -p gnupg/NEWS >>$pgm.tmp/NEWS
cvs -Q checkout -p gnupg/BUGS | sed '1,/^~~~~~~~~~~~/ d' > $pgm.tmp/BUGS
echo "(List generated from CVS: " $(date +%Y-%m-%d) ")" >> $pgm.tmp/BUGS
sed_it $pgm.tmp $pgm.new
1999-05-23 17:29:35 +00:00
rm -rf $pgm.tmp || true
1999-05-23 17:33:59 +00:00
ln -sf gnupg.html $pgm.new/index.html
1999-05-23 17:17:09 +00:00
1999-05-23 17:29:35 +00:00
rm -rf $pgm.old || true
[ -d $pgm ] && mv $pgm $pgm.old
if ! mv $pgm.new $pgm ; then
echo "rename failed - restoring" >&2
mv $pgm.old $pgm
exit 1
fi
rm -rf $pgm.old || true
}
do_export gnupg-www gnupg-www
#cd gnupg-www
#tar czf /home/ftp/pub/gcrypt/.old/webpages.tmp *
#mv /home/ftp/pub/gcrypt/old/webpages.tmp /home/ftp/pub/gcrypt/old/webpages.tar.gz
exit 0