#! /bin/sh

###
### $Header: /home/gene/src/gogl/RCS/copy-to-website,v 3.2 2003/05/27 00:32:50 gene Exp $
###
### Copyright (c) 2003 Gene Michael Stover.  All rights reserved.
###
### This file is free software; you can redistribute it and/or modify
### it under the terms of the GNU General Public License as published by
### the Free Software Foundation; either version 2 of the License, or
### (at your option) any later version.
### 
### This program is distributed in the hope that it will be useful,
### but WITHOUT ANY WARRANTY; without even the implied warranty of
### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
### GNU General Public License for more details.
### 
### You should have received a copy of the GNU General Public License
### along with this program; if not, write to the Free Software
### Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
###
### By Gene Michael Stover
### Sunday, 4 May 2003
###

###
### The directory in Website that contains the Tigris documentation.  It
### also contains a Tigris distro & a copy of the sources.
###
### This pathname is highly specific to Gene Michael Stover's development
### environment.
###
WEB=$HOME/library/website/docsrc/tigris

if test -d $WEB/src || mkdir -p $WEB/src; then
    ##
    ## Remove the archive that's currently in the website.
    ## Don't really remove it.  Instead, move to the trash.
    ##
    for F in $WEB/tigris-*.cpio.bz2 $WEB/tigris-*.tar.gz; do
        if test -f $F; then
            mv $F $HOME/.trash
        fi
    done
    
    ##
    ## Copy the latest distros to the Web site.
    ##
    CPIO=`cd ..; ls -1 tigris-*.cpio.bz2 |tail -n 1`
    TAR=`cd ..; ls -1 tigris-*.tar.gz |tail -n 1`
    echo cp ../$CPIO ../$TAR $WEB
    cp ../$CPIO ../$TAR $WEB
    
    ##
    ## Copy the source directory tree to the Website.  Since there are a
    ## bunch of things we don't want to copy, the easiest way to
    ## filter those things is to expand a distro into the directory.
    ##
    if test -d $WEB/src/tigris; then
       mv $WEB/tigris $HOME/.trash
    fi
    bzcat ../$CPIO |(cd $WEB/src; cpio -id)
    mv $WEB/src/tigris-`cat version` $WEB/src/tigris
    
    ##
    ## Make a make-makefile-in.ignore so make-makefile-in won't
    ## generate rules for the files in it.
    ##
    date >$WEB/src/make-makefile-in.ignore
else
    echo Error: $WEB/src does not exist \& I cannot create it.
    exit 1
fi

### --- end of file ---
