Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

119 wiersze
2.7KB

  1. #!/bin/sh
  2. package='tufte-latex'
  3. class='tufte-handout.cls'
  4. # Exit on first error:
  5. set -e
  6. # Verify prerequisites:
  7. if test $# -ne 1
  8. then
  9. echo "Usage: $0 VERSION"
  10. exit 1
  11. fi
  12. version=$1
  13. if ! echo $version | grep -E "^[0-9]+\.[0-9]+\.[0-9]+$"
  14. then
  15. echo "VERSION should be of the form 1.2.5 (major.minor.revision)"
  16. exit 1
  17. fi
  18. if ! grep -q $version $class
  19. then
  20. echo "Error: version skew. '$version' does not match that in class"
  21. grep -H ProvidesClass $class
  22. exit 1
  23. fi
  24. if ! grep -q $version History.txt
  25. then
  26. echo "Error: no release notes for '$version' found in History.txt"
  27. grep -H $version History.txt
  28. exit 1
  29. fi
  30. class_date=`date +%Y/%m/%d` # (with slashes)
  31. if ! grep -q $class_date $class
  32. then
  33. echo "Error: date skew. '$class_date' does not match that in class"
  34. grep -H ProvidesClass $class
  35. exit 1
  36. fi
  37. history_date=`date +%Y-%m-%d` # (with dashes)
  38. if ! grep -q $history_date History.txt
  39. then
  40. echo "Error: '$history_date' not found in History.txt"
  41. grep -H $history_date History.txt
  42. exit 1
  43. fi
  44. # Refresh sample document
  45. pdflatex sample-handout > refresh-sample.log
  46. bibtex sample-handout >> refresh-sample.log
  47. pdflatex sample-handout >> refresh-sample.log
  48. pdflatex sample-handout >> refresh-sample.log
  49. rm -f sample-handout.{aux,log,out,blg,bbl} refresh-sample.log
  50. # To ease googlecode upload, make a distinct version of sample-handout:
  51. cp sample-handout.pdf sample-handout-$version.pdf
  52. # Make bundle for Google Code release
  53. mkdir -p pkg/$package-$version
  54. tar cf - `cat Manifest.txt` | ( cd pkg/$package-$version && tar xf - )
  55. ( cd pkg && zip -rq $package-$version.zip $package-$version )
  56. # Make bundle for CTAN release
  57. TDS_DIR=pkg/$package/tds/
  58. TDS_TEX_DIR=$TDS_DIR/tex/latex/$package/
  59. TDS_DOC_DIR=$TDS_DIR/doc/latex/$package/
  60. TDS_SRC_DIR=$TDS_DIR/source/latex/$package/
  61. mkdir -p $TDS_DIR $TDS_TEX_DIR $TDS_DOC_DIR $TDS_SRC_DIR
  62. cp tufte-handout.cls $TDS_TEX_DIR/
  63. cp History.txt README.txt sample-handout.{pdf,tex,bib} $TDS_DOC_DIR/
  64. mkdir $TDS_DOC_DIR/graphics
  65. cp graphics/* $TDS_DOC_DIR/graphics/
  66. cp tufte-handout.cls sample-handout.{tex,bib} $TDS_SRC_DIR/
  67. ( cd $TDS_DIR && zip -rq ../../$package-$version/$package.tds.zip * )
  68. rm -fr pkg/$package
  69. mv pkg/$package-$version pkg/$package
  70. ( cd pkg && zip -rq $package.zip $package )
  71. # Remove our temporary files
  72. rm -fr pkg/$package
  73. # Provide some cut-n-paste material for manual steps:
  74. cat << MESSAGE
  75. `openssl dgst -sha1 pkg/$package-$version.zip`
  76. Don't forget to create an SVN tag (after committing changes),
  77. svn cp -m'To tag release $version.' \\
  78. https://$package.googlecode.com/svn/trunk \\
  79. https://$package.googlecode.com/svn/tags/rel_$version
  80. and upload the zip file,
  81. http://code.google.com/p/$package/downloads/list
  82. http://ctan.org/upload
  83. MESSAGE