Subversion Repositories wimsdev

Rev

Rev 12899 | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. #! /bin/sh
  2. #
  3. # Recense new resources on the neighbor class.
  4. #
  5. # Output line: resource_type resource_name type
  6. # type=1: new type=2: exist but different
  7.  
  8. mdir=`pwd`
  9.  
  10. nei=$w_wims_home/log/classes/$w_nei
  11. cd $w_wims_home/log/classes/$w_wims_class
  12. cldir=`pwd`
  13. cd $nei
  14. ndir=`pwd`
  15. cd $cldir
  16.  
  17. if [ $w_itype = motd ]; then
  18.  cp $nei/.motd .
  19.  echo success
  20.  exit
  21. fi
  22.  
  23. if [ $w_itype = exo ]; then
  24.  mkdir -p src def
  25.  cp $nei/src/$w_iname src
  26.  exoroot=`echo $w_iname | sed 's/\.oef$//'`
  27.  if [ -d $nei/src/images/$exoroot ]; then
  28.   mkdir -p src/images
  29.   cp -R $nei/src/images/$exoroot src/images
  30.  fi
  31.  cd $cldir
  32.  msg=`src2def oef`
  33.  echo success
  34.  echo "$msg"
  35.  exit
  36. fi
  37.  
  38. if [ $w_itype = sheet ]; then
  39.  cp $nei/sheets/.sheet$w_iname sheets/.sheet$w_replace
  40.  if [ -e $nei/sheets/sheet$w_iname.src ]; then
  41.    cp $nei/sheets/sheet$w_iname.def sheets/sheet$w_replace.def;
  42.    cp $nei/sheets/sheet$w_iname.src sheets/sheet$w_replace.src;
  43.  fi
  44.  echo success
  45.  exit
  46. fi
  47.  
  48. if [ $w_itype = exam ]; then
  49.  cp $nei/exams/.exam$w_iname exams/.exam$w_replace
  50.  echo success
  51.  exit
  52. fi
  53.  
  54. if [ $w_itype = glossary ]; then
  55.  cp $nei/tool/.glossary$w_iname tool/.glossary$w_replace
  56.  echo success
  57.  exit
  58. fi
  59.  
  60. if [ $w_itype = doc ]; then
  61.  rm -fR doc/c$w_replace 2>/dev/null
  62.  mkdir -p doc >/dev/null
  63.  cp -R $nei/doc/c$w_iname doc/c$w_replace
  64.  echo success
  65.  exit
  66. fi
  67.  
  68.