#!/bin/sh usage() { echo "Usage: fixCVS" echo " -- Patch a CVS working directory to match the modified" echo " -- repository. cpphs is now stored in darcs, not CVS" exit 1 } case $# in 0) ;; *) usage; exit 1 ;; esac if [ -d src/cpphs -a -d src/cpphs-cvs ] then echo "`basename $0` has been run already? src/cpphs-cvs exists" exit 1 fi if [ -d src/cpphs -a -d src/cpphs/_darcs ] then echo "`basename $0` has been run already? src/cpphs darcs exists" exit 1 fi if [ -d src/cpphs ] then echo "Moving old src/cpphs to src/cpphs-cvs" && mv src/cpphs src/cpphs-cvs && echo "Removing cpphs from src/CVS/Entries file" && sed -e '/cpphs/d' src/CVS/Entries >src/CVS/Entries.new && mv src/CVS/Entries.new src/CVS/Entries fi && echo "Getting darcs src/cpphs" && darcs get --partial --repo-name=src/cpphs http://www.cs.york.ac.uk/fp/darcs/cpphs && echo "Retrieving older version of Data.Tree" && cvs update -r1.12 src/libraries/base/Data/Tree.hs && echo "Finished" exit 0; # everything below here is obsolete (removed Dec 2005) usage() { echo "Usage: fixCVS (nhc98 | hat)" echo " -- Patch a CVS working directory to match the modified" echo " -- repository. Invoke from either the nhc98 or hat dir." exit 1 } replace () { current=$1 new=$2 echo "replace: $current -> $new" echo $new >$current/CVS/Repository } case $# in 1) baselocation=$1 ;; *) usage ;; esac case $baselocation in nhc98) if [ -d src/cpphs ] then replace src/cpphs cpphs replace src/cpphs/tests cpphs/tests replace src/cpphs/docs cpphs/docs fi replace src/hsc2hs fptools/ghc/utils/hsc2hs LIBRARIES=`cd src; find libraries -type d ! -name CVS` for lib in $LIBRARIES do if [ -d src/$lib/CVS ] then replace src/$lib fptools/$lib fi done ;; hat) replace src/compiler98 nhc98/src/compiler98 replace src/compiler98/hugs nhc98/src/compiler98/hugs ;; *) usage ;; esac