#!/bin/csh
### --- The University of Birmingham 1999. --------------------------------
### $poplocal/local/ftp/bin/insert.copyright
# Aaron Sloman Sun Aug 29 14:34:24 BST 1999
# Modified 5 Jan 2002 to use new copyright notice

# assume this is invoked in the ftp directory with gzipped
# tar files in format: file.tar.gz

set ftp = $poplocal/local/ftp

cd $ftp/new

mkdir tempexpand.dir

cd tempexpand.dir

pwd

set tempdir = `pwd`

echo "expanding $1"

time zcat ../$1 | tar xf -

mv ../$1 ../$1.bak

echo "renamed $1.bak"

echo "expanded $1. Adding installation notes"

rm -f INSTALL.TXT
cp -p ../install.txt  .

cp -p ../../copyright.html .

echo "installing bugfixes"

cd $tempdir/pop/lisp/src

zcat $ftp/bugfixes/lisp/src/lisp-src-bugs.tar.gz | tar xvf -

cd $tempdir/pop/help

cp -p $ftp/bugfixes/help/* .

cd $tempdir/pop/teach

cp -p $ftp/bugfixes/teach/* .

cd $tempdir/pop/lib

cp -rp $ftp/bugfixes/lib/* .

echo "done"

echo "compressing"

time tar cf - * | gzip > ../$1

echo compressed

cd ..

ls -l $1*

echo "removing temporarily expanded files"

time rm -rf tempexpand.dir

echo "done"
