#!/bin/csh

#

# Full Renew for Demostration System

#

# T.Morita 

# $Id: newdemo,v 1.3 2000/08/03 08:07:16 usr04098 Exp $

#



if( `hostname -s` != hunter || $1 == "-h" || $2 == "-h" ) then

    echo "Usage: newdemo [-options]"

    echo "    Renew all source and data for DEMO System."

    echo "    This command is ONLY VALID in the host named 'HUNTER'."

    echo "  options:"

    echo "      -h  show this"

    exit 1 ;



else if ( -f /usr/local/develop/demo/._LOCKFILE ) then

    echo "Currently renewing the system by someone."

    exit 1 ;



else

    echo "Start renewing the system."

    cd /usr/local/develop/demo/$USER/mgs2



#   Set Lockfile for prevending renewing concurrently

    touch /usr/local/develop/demo/._LOCKFILE



#     Renew whole system

      unsetenv MGS2_USBPREV MGS2_PREVIEW MGS2_DESIGN

      cvs update module source

      make all || make clean all || echo "System has wrong MAKEFILE"



    rm  /usr/local/develop/demo/._LOCKFILE

    echo "Finish renewing the system."

    exit 0 ;



endif



