migrate.sh 792 B

123456789101112131415161718192021222324252627
  1. #!/bin/sh -x
  2. # This is a script to take a Moodle <1.9 install and make it work on Moodle >=2.0
  3. # Copyright Edmund Edgar, 2011-06-20
  4. # Licensed under the same terms as Sloodle itself.
  5. if test $# -eq 0
  6. then
  7. echo "Usage: php migrate.php /path/to/sloodle/top/dir";
  8. exit 1
  9. fi
  10. THIS_DIR=$(cd `dirname $0` && pwd)
  11. APPLY_TO=$1
  12. echo "applying to ${APPLY_TO}"
  13. echo "applying from ${THIS_DIR}"
  14. cd ${APPLY_TO}
  15. # Replace legacy Moodle functions with sloodle_ wrappers
  16. find . -type f ! -regex ".*[/]\.svn[/]?.*" -exec sed -f ${THIS_DIR}/sloodle_wrappers.sed -i {} \;
  17. # Patch various misc changes, including the new wrapper functions
  18. patch -p1 < ${THIS_DIR}/sloodle.patch
  19. # Rename the language directories to drop the utf8
  20. for x in `ls -d lang/*_utf8 | sed 's/_utf8$//' `; do mv ${x}_utf8 $x; done