home *** CD-ROM | disk | FTP | other *** search
/ OpenStep (Enterprise) / OpenStepENTCD.toast / OEDEV / EODEV.Z / install_database < prev    next >
Encoding:
Text File  |  1996-08-24  |  1.4 KB  |  51 lines

  1. #!/bin/sh
  2.  
  3. #
  4. # Loop through arguments and set initial values
  5. #
  6. while test $# -gt 0
  7. do
  8.     case $1 in
  9.     -#)
  10.         set -x;;
  11.     esac
  12.     shift
  13. done    
  14.  
  15. masterDir="${NEXT_ROOT}/NextDeveloper/Examples/EnterpriseObjects"
  16. EOUTIL=${NEXT_EOUTIL_PATH-${masterDir}/DatabaseSetUp/eoutil}
  17.  
  18. #
  19. # Get the current working directory and verify that we're in the right place
  20. #
  21. exepath=`echo $0`
  22. basename=`basename $exepath`
  23. currDir=`echo $exepath | sed -e s,$basename\$,, | sed -e s,/\$,,`
  24. if test ! -z "$currDir"; then
  25.     cd $currDir
  26. fi
  27. currDir=`pwd`
  28.  
  29. if test ! -d ../BusinessLogic -o ! -f MovieData.plist; then
  30.     echo ""
  31.     echo "You must be in the 'DatabaseSetUp' directory of the *copied*"
  32.     echo "examples directory in order to run this script, please cd to that"
  33.     echo "directory and execute this script again."
  34.     exit 1;
  35. fi
  36.     
  37. if test $"currDir" = $"masterDir/DatabaseSetUp"; then
  38.     echo ""
  39.     echo "Cannot install data from $masterDir. Please copy the examples and cd to"
  40.     echo "the copied directory. Configure the examples by running configure_examples"
  41.     echo "and execute this script again."
  42.     exit 1
  43. fi
  44.  
  45. echo Loading schema and data for Movies database, please wait...
  46. ${EOUTIL} dump ../BusinessLogic/Movies.eomodeld -source plist MovieData.plist -dest database -schemaCreate
  47.  
  48. echo Loading schema and data for Rentals database, please wait...
  49. ${EOUTIL} dump ../BusinessLogic/Rentals.eomodeld -source plist RentalData.plist -dest database -schemaCreate -postInstall
  50.  
  51.