diff options
author | Werner Koch <wk@gnupg.org> | 1999-09-30 14:40:01 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 1999-09-30 14:40:01 +0200 |
commit | df4ecbb8d9b859eec47294ad3276b6a962635a6f (patch) | |
tree | 2854d665686fd78a91038f43c58b4dfeeb1d73b0 | |
parent | See ChangeLog: Sat Sep 18 12:16:08 CEST 1999 Werner Koch (diff) | |
download | gnupg2-df4ecbb8d9b859eec47294ad3276b6a962635a6f.tar.xz gnupg2-df4ecbb8d9b859eec47294ad3276b6a962635a6f.zip |
Changed the way it works - now needs an extra program to to most tasks.
-rwxr-xr-x | scripts/mkwebpage | 118 |
1 files changed, 28 insertions, 90 deletions
diff --git a/scripts/mkwebpage b/scripts/mkwebpage index b39feb176..811de2a11 100755 --- a/scripts/mkwebpage +++ b/scripts/mkwebpage @@ -1,105 +1,43 @@ #!/bin/sh # Make a snapshot of the CVS head revision for the gnupg webpages - set -e -cd $HOME/pub - -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. - # 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' -} - -# We have to edit most files -sed_it () { - src=$1 - dst=$2 +myhome="$HOME/pub" +pgm="gnupg-www" +mod="gnupg-www" +MKWEBSITE=$HOME/bin/mkwebsite - 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 - } - /@HOSTEDBY@/ { - r $src/hostedby.html.inc - d - } - " $sf > $df - ;; - *.html.inc | *~ | *.tmp | */BUGS ) - : - ;; - *) - cat $sf > $df - ;; - esac - done - done -} +cd $myhome -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.tmp $mod - cat <<EOF >$pgm.tmp/NEWS +rm -rf $pgm.tmp 2>/dev/null || true +rm -rf $pgm.new || true +mkdir $pgm.new || true +rm -rf $pgm.old || true +cvs -Q export -r HEAD -d $pgm.tmp $mod +cat <<EOF >$pgm.tmp/en/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". + "Noteworthy changes in version 1.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 - rm -rf $pgm.tmp || true - ln -sf gnupg.html $pgm.new/index.html - - 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 +cvs -Q checkout -p gnupg/NEWS >>$pgm.tmp/en/NEWS +cvs -Q checkout -p gnupg/BUGS | sed '1,/^~~~~~~~~~~~/ d' > $pgm.tmp/en/include-file-1.tmp +echo "(List generated from CVS: " $(date +%Y-%m-%d) ")" >> $pgm.tmp/en/include-file-1.tmp +cd $pgm.tmp +$MKWEBSITE --cvs --use-this-dir $myhome/$pgm.new +cd $myhome +rm -rf $pgm.tmp || true + +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 |