diff options
author | Werner Koch <wk@gnupg.org> | 1999-05-23 19:17:09 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 1999-05-23 19:17:09 +0200 |
commit | 3e2c46af6b33709d13876fe9a3143288f7b9d187 (patch) | |
tree | f1512daad5cc41b29d6c04c14ad7c359de1e286e /scripts/mkwebpage | |
parent | See ChangeLog: Sun May 23 14:20:22 CEST 1999 Werner Koch (diff) | |
download | gnupg2-3e2c46af6b33709d13876fe9a3143288f7b9d187.tar.xz gnupg2-3e2c46af6b33709d13876fe9a3143288f7b9d187.zip |
*** empty log message ***
Diffstat (limited to '')
-rwxr-xr-x | scripts/mkwebpage | 89 |
1 files changed, 63 insertions, 26 deletions
diff --git a/scripts/mkwebpage b/scripts/mkwebpage index bdb1bbf3c..10d170c79 100755 --- a/scripts/mkwebpage +++ b/scripts/mkwebpage @@ -6,43 +6,80 @@ set -e -cd $HOME/pub +#cd $HOME/pub - -fix_it () { - dir=$1 - - cat <<EOF >$dir/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 >>$dir/NEWS - cvs -Q checkout -p gnupg/BUGS >>$dir/BUGS - here=`pwd` - cd $dir - ln -sf gnupg.html index.html - sed -n '1,/@BEGIN_BUGLIST@/ p' buglist.html >buglist.tmp - sed '1,/^~~~~~~~~~~~/ d' BUGS >>buglist.tmp - echo "(List generated from CVS: " $(date +%Y-%m-%d) ")" >>buglist.tmp - sed -n '/@END_BUGLIST@/,$ p' buglist.html >>buglist.tmp - mv buglist.tmp buglist.html - cd $here +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. + sed '/^.*\$Id$.*$/q' $1 | + sed -n 's!^.*\$Id$!\1-\2-\3 \4!p' } +# 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 + } + " $sf > $df + ;; + *.html.inc | *~ | *.tmp | */BUGS ) + : + ;; + *) + cat $sf > $df + ;; + esac + done + done +} do_export () { pgm=$1 mod=$2 + rm -rf $pgm.tmp 2>/dev/null || true rm -rf $pgm.new || true rm -rf $pgm.old || true - cvs -Q export -r HEAD -d $pgm.new $mod - fix_it $pgm.new + 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 + fix_it $pgm.tmp $pgm.new + rm -rf $pgm.old || true + [ -d $pgm ] && mv $pgm $pgm.old if ! mv $pgm.new $pgm ; then echo "rename failed - restoring" >&2 |