Admin/makepage
author paulson
Fri, 26 May 2000 18:05:34 +0200
changeset 8984 b71c460c6f97
parent 8223 960ca167cfc5
child 9287 c406d0af9368
permissions -rwxr-xr-x
addss -> force_tac

#!/bin/bash
#
# $Id$
#
# makemainpage -- make main Isabelle web pages

TARGET=/usr/proj/isabelle-repository/www
FILES="index.html docs.html about.html cambridge.gif munich.gif"
PREFIX=main

PRG=$(basename $0)
THIS=$(cd $(dirname "$0"); echo $PWD)

function usage()
{
  echo
  echo "Usage: $PRG VERSION DIST"
  echo
  cat <<EOF
  Make Isabelle main web pages with links to documentation for VERSION

  VERSION should be the Isabelle version contained in DIST
  DIST should be an Isabelle distribution archive or directory

EOF
  exit 1
}

function fail()
{
  echo "$1" >&2
  exit 2
}


## process command line

[ $# -ne 2 ] && usage

export DISTNAME=$1
shift
DIST=$1

cd $THIS/page

if [ -d $DIST ]; then
    cp $DIST/doc/Contents .
else
  if [ -f $DIST ]; then
      gzip -dc $DIST | tar -Bxf - $DISTNAME/doc/Contents 
      mv $DISTNAME/doc/Contents .
      rmdir -p $DISTNAME/doc
  else 
      echo error: $DIST not found
      fail
  fi
fi

make main

for FILE in $FILES; do
    cp -f $PREFIX/$FILE $TARGET
done

chmod g=u $TARGET/*

( cd $TARGET; echo -e "\nYou should find the Isabelle pages in $PWD"; )