Subversion Repositories wimsdev

Rev

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

  1. #! /bin/sh
  2. #
  3. # chroot package cannot be updated automatically, because it is
  4. # system-dependent.
  5.  
  6. whome=`pwd`
  7.  
  8. eraselink="public_html/modules/template
  9. public_html/modules/adm
  10. public_html/modules/home
  11. public_html/modules/classes
  12. public_html/html
  13. "
  14.  
  15. if [ -z "$loadversion" ]; then
  16.  echo Please execute this via an appropriate update script.
  17.  exit
  18. fi
  19. if [ ! -f public_html/wims ]; then
  20.  echo Wrong execution directory.
  21.  exit
  22. fi
  23. if [ ! -f download/wims-$loadversion.tgz ]; then
  24.  echo Wrong updating procedure: no tgz file found.
  25. fi
  26.  
  27. rm -Rf update 2>/dev/null
  28. mkdir -p update
  29. cd update
  30.  
  31. echo Expanding system package wims-$loadversion.tgz.
  32. tar -xzf ../download/wims-$loadversion.tgz
  33. echo `date '+%H:%M:%S'`: Compilation starts.
  34. cd src
  35. ./configure >>../../log/update2.log 2>&1
  36. make all >>../../log/update2.log 2>&1
  37. cd ..
  38. if [ ! -f public_html/wims ]; then
  39.  echo Compilation failed. Sorry.
  40.  exit
  41. fi
  42. echo `date '+%H:%M:%S'`: Compilation finished.
  43. rm -f log/unsecure log/update-version
  44. if [ -d ../testing ]; then
  45.  load=$whome/testing
  46. else
  47.  load=$whome
  48.  for d in $eraselink
  49.  do
  50.   find $load/$d -type l -exec rm '{}' \;
  51.  done
  52.  if [ -d $load/public_html/w/adm/local ]; then
  53.   ln -s ../../w/adm/local $load/public_html/modules/adm
  54.  fi
  55.  if [ -f $load/public_html/bin/ch..root ]; then
  56.   cmp -s src/Misc/chroot.c $load/src/Misc/chroot.c 2>/dev/null && rm -f public_html/bin/ch..root
  57.  fi
  58.  if [ -f $load/public_html/bin/wrap..exec ]; then
  59.   cmp -s src/Misc/wrap.c $load/src/Misc/wrap.c 2>/dev/null && rm -f public_html/bin/wrap..exec
  60.  fi
  61.  if [ -f $load/bin/wimsd ]; then
  62.   cmp -s src/Wimsd/wimsd.c $load/src/Wimsd/wimsd.c 2>/dev/null && rm -f bin/wimsd
  63.  fi
  64.  if [ -f public_html/bin/ch..root ] || [ -f public_html/bin/wrap..exec ] || [ -f bin/wimsd ]; then
  65.   echo yes >$load/log/unsecure
  66.   for f in bin/wimsd public_html/bin/ch..root public_html/bin/wrap..exec; do
  67.    [ -f $f ] && rm -f $load/$f
  68.   done
  69.  fi
  70.  mkdir -p $load/tmp/log
  71.  mv -f tmp/log/wimslogd.new $load/tmp/log
  72. fi
  73.  
  74. echo WIMS server shut down.
  75. echo `date '+%H:%M:%S'`: update system files.
  76. $load/bin/server-interrupt >>../log/update2.log
  77. cp -upR * $load
  78.  
  79. echo `date '+%H:%M:%S'`: System update finished.
  80. #$load/bin/server-resume
  81.  
  82. #cd $load/public_html/modules
  83. #for f in $whome/download/wims_modules*
  84. #do
  85. # echo Expanding $f
  86. # tar -xzf $f
  87. #done
  88.  
  89. cd $load
  90. echo `date '+%H:%M:%S'`: Update system indexes.
  91. bin/update
  92. bin/mkindex
  93. for m in H3/algebra/spuzzle U2/algebra/qpuzzle; do
  94.  if [ -x public_html/modules/$m/makepieces ]; then
  95.   public_html/modules/$m/makepieces
  96.  fi
  97. done
  98. bin/server-resume
  99. echo `date '+%H:%M:%S'`: Clean up.
  100. rm -Rf $whome/update
  101. rm -f tmp/log/wimslogd.pid
  102. echo `date '+%H:%M:%S'`: End of update.
  103.  
  104.