sync.sh 969 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. # This Source Code Form is subject to the terms of the Mozilla Public
  2. # License, v. 2.0. If a copy of the MPL was not distributed with this
  3. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
  4. if [ $# = 0 ] ; then
  5. echo "usage: ./sync.sh ots-git-directory"
  6. exit 1
  7. fi
  8. echo "Updating LICENSE..."
  9. cp $1/LICENSE .
  10. echo "Updating src..."
  11. cd src
  12. ls | fgrep -v moz.build | xargs rm -rf
  13. cp -r $1/src/* .
  14. cd ..
  15. echo "Updating include..."
  16. rm -rf include/
  17. cp -r $1/include .
  18. echo "Updating tests..."
  19. rm -rf tests/*
  20. mkdir -p tests
  21. cp -r $1/tests/*.cc tests
  22. echo "Updating README.mozilla..."
  23. REVISION=`cd $1; git log | head -1 | sed "s/commit //"`
  24. VERSION=`cd $1; git describe | cut -d '-' -f 1 | sed 's/v//'`
  25. sed -e "s/\(Current revision: \).*/\1$REVISION \($VERSION\)/" README.mozilla > README.tmp
  26. mv README.tmp README.mozilla
  27. echo "Applying ots-visibility.patch..."
  28. patch -p3 < ots-visibility.patch
  29. echo "Applying ots-lz4.patch..."
  30. patch -p3 < ots-lz4.patch