head	1.12;
access;
symbols
	DEVEL-BRANCH-1-1:1.12
	V1-0-0:1.12
	V0-9-11:1.12
	V0-9-10:1.11
	V0-9-9:1.10
	V0-9-8:1.10
	V0-9-7:1.10
	V0-9-6:1.5
	V0-9-5:1.5
	V0-9-4:1.5
	V0-9-3:1.3
	V0-9-2:1.1
	V0-9-1:1.1;
locks; strict;
comment	@# @;


1.12
date	99.09.02.14.50.38;	author wkoch;	state Exp;
branches;
next	1.11;

1.11
date	99.07.24.09.59.06;	author wkoch;	state Exp;
branches;
next	1.10;

1.10
date	99.05.23.17.41.43;	author wkoch;	state Exp;
branches;
next	1.9;

1.9
date	99.05.23.17.33.59;	author wkoch;	state Exp;
branches;
next	1.8;

1.8
date	99.05.23.17.29.35;	author wkoch;	state Exp;
branches;
next	1.7;

1.7
date	99.05.23.17.24.01;	author wkoch;	state Exp;
branches;
next	1.6;

1.6
date	99.05.23.17.17.09;	author wkoch;	state Exp;
branches;
next	1.5;

1.5
date	99.02.22.19.14.15;	author koch;	state Exp;
branches;
next	1.4;

1.4
date	99.02.22.19.08.46;	author koch;	state Exp;
branches;
next	1.3;

1.3
date	99.02.13.11.19.13;	author koch;	state Exp;
branches;
next	1.2;

1.2
date	99.02.10.16.22.37;	author koch;	state Exp;
branches;
next	1.1;

1.1
date	99.01.09.17.59.56;	author koch;	state Exp;
branches;
next	;


desc
@@


1.12
log
@See ChangeLog: Thu Sep  2 16:40:55 CEST 1999  Werner Koch
@
text
@#!/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

    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
}


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
[ 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
    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

@


1.11
log
@.
@
text
@a2 2
# and put them into the FTP directory (so that the mirrors w/o rsync
# can access them
d99 3
a101 3
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
@


1.10
log
@mkwebpage
@
text
@d47 4
@


1.9
log
@mkwebpage
@
text
@d14 3
a16 2
    sed '/^.*\$\[I\]d:.*\$.*$/q' $1 |
    sed -n 's!^.*\$\[I\]d: [^ ]\+ [^ ]\+ \([0-9]*\)/\([0-9]*\)/\([0-9]*\) [^ ]\+ \([^ ]\+\).*$!\1-\2-\3 \4!p'
@


1.8
log
@*** empty log message ***
@
text
@d81 1
@


1.7
log
@*** empty log message ***
@
text
@d9 1
a9 1
#cd $HOME/pub
d80 2
a81 1
    fix_it $pgm.tmp $pgm.new
a82 1

@


1.6
log
@*** empty log message ***
@
text
@d14 2
a15 2
    sed '/^.*\$Id:.*\$.*$/q' $1 |
    sed -n 's!^.*\$Id: [^ ]\+ [^ ]\+ \([0-9]*\)/\([0-9]*\)/\([0-9]*\) [^ ]\+ \([^ ]\+\).*$!\1-\2-\3 \4!p'
@


1.5
log
@*** empty log message ***
@
text
@d9 1
a9 1
cd $HOME/pub
d11 47
a58 2
fix_it () {
    dir=$1
d60 9
a68 1
    cat <<EOF >$dir/NEWS
d76 6
a81 14
    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
}


a82 8
do_export () {
    pgm=$1
    mod=$2

    rm -rf $pgm.new || true
    rm -rf $pgm.old || true
    cvs -Q export -r HEAD -d $pgm.new $mod
    fix_it $pgm.new
@


1.4
log
@See ChangeLog: Mon Feb 22 20:04:00 CET 1999  Werner Koch
@
text
@d30 1
a30 1
    echo "(List generated from CVS: " `date -R` ")"  >>buglist.tmp
@


1.3
log
@See ChangeLog: Sat Feb 13 12:14:42 CET 1999  Werner Koch
@
text
@d24 1
d28 5
@


1.2
log
@See ChangeLog: Wed Feb 10 17:15:39 CET 1999  Werner Koch
@
text
@d3 3
d19 1
a19 1
            					     (wk $(date +%Y-%m-%d)) ]
d51 4
@


1.1
log
@See ChangeLog: Sat Jan  9 18:54:57 CET 1999  Werner Koch
@
text
@d21 4
@
