v8-snapshot.sh 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/bash
  2. set -e
  3. tmp=$(mktemp -d)
  4. trap cleanup EXIT
  5. cleanup() {
  6. set +e
  7. [ -z "$tmp" -o ! -d "$tmp" ] || rm -rf "$tmp"
  8. }
  9. unset CDPATH
  10. pwd=$(pwd)
  11. dirname=v8
  12. cd "$tmp"
  13. #svn checkout http://v8.googlecode.com/svn/trunk $dirname
  14. svn checkout -r 6522 http://v8.googlecode.com/svn/trunk $dirname
  15. cd $dirname
  16. MAJOR_VERSION=$(grep "#define MAJOR_VERSION" src/version.cc | sed -e "s/#define MAJOR_VERSION[[:blank:]]*//" -e "s/[[:blank:]]*$//")
  17. MINOR_VERSION=$(grep "#define MINOR_VERSION" src/version.cc | sed -e "s/#define MINOR_VERSION[[:blank:]]*//" -e "s/[[:blank:]]*$//")
  18. BUILD_NUMBER=$(grep "#define BUILD_NUMBER" src/version.cc | sed -e "s/#define BUILD_NUMBER[[:blank:]]*//" -e "s/[[:blank:]]*$//")
  19. VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${BUILD_NUMBER}
  20. REVISION=`LC_ALL=C svn info 2> /dev/null | grep Revision | cut -d' ' -f2`
  21. find . -type d -name .svn -print0 | xargs -0r rm -rf
  22. cd ..
  23. mv $dirname ${dirname}-${VERSION}
  24. tar jcf "$pwd"/${dirname}-${VERSION}.svn${REVISION}.tar.bz2 ${dirname}-${VERSION}
  25. cd ${pwd} >/dev/null
  26. exit