make-release 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. #!/bin/sh
  2. if [ -d rtmp ]; then
  3. echo "rtmp exists"
  4. exit
  5. fi
  6. branch=$1
  7. if [ "$branch" = "" ]; then
  8. echo "Syntax: $0 BRANCH_x_x"
  9. exit
  10. elif [ "$branch" = "trunk" ]; then
  11. branch=""
  12. else
  13. branch="-r $branch"
  14. fi
  15. echo "Making temporary working directory (rtmp)..."
  16. mkdir rtmp || exit
  17. cd rtmp || exit
  18. echo "Checking out $branch source..."
  19. eval "cvs co $branch genesis" || exit
  20. version=`cat genesis/etc/version`
  21. lmajor=`echo $version | cut -d. -f1`
  22. lminor=`echo $version | cut -d. -f2`
  23. lpatch=`echo $version | cut -d. -f3`
  24. lrelease=`echo $lpatch | cut -d- -f2`
  25. lpatch=`echo $lpatch | cut -d- -f1`
  26. lpatch=`expr $lpatch + 1`
  27. echo "Previous Release: $version"
  28. while [ 1 ]; do
  29. echo -n "New Release [$lmajor.${lminor}.$lpatch-$lrelease] "
  30. read next
  31. if [ -z "$next" ]; then
  32. next="$lmajor.${lminor}.$lpatch-$lrelease"
  33. break
  34. else
  35. echo -n "Use '$next' as the next release? [yes] "
  36. read yesno
  37. if [ -z "$yesno" -o "$yesno" = "y" -o "$yesno" = "yes" ]; then
  38. break
  39. fi
  40. fi
  41. done
  42. nrel="Genesis-$next"
  43. cd genesis
  44. echo $next > etc/version
  45. num=`echo $next | sed -e 's/-[A-Z][A-Z]*$//'`
  46. date=`perl -e '($mday,$mon,$yr)=(localtime())[3..5];
  47. @months = ("Jan","Feb","Mar","Apr","May","Jun",
  48. "Jul","Aug","Sep","Oct","Nov","Dec");
  49. print "$mday-$months[$mon]-$yr\n";'`
  50. str=`printf "%-7s[%s]" $num $date`
  51. chngs=doc/CHANGES
  52. notes=etc/notes
  53. ## update the changes file
  54. mv $chngs $chngs.bak
  55. perl -e "while (<STDIN>) { s/\x0c/\x0c\n$str/; print; }" < $chngs.bak > $chngs
  56. vi doc/CHANGES
  57. ## update the release notes
  58. mv $notes $notes.bak
  59. perl -e "while (<STDIN>) { (/^RELEASE/) && exit; print; }" <$notes.bak> $notes
  60. echo "RELEASE INFORMATION:" >> $notes
  61. perl -e "\$incr=0;
  62. while (<STDIN>) {
  63. if (\$incr) {
  64. if (/^(\x0b|\x0c)/) {
  65. exit;
  66. } else {
  67. print;
  68. }
  69. } elsif (/\x0c/) {
  70. \$incr = 1;
  71. }
  72. }" < $chngs >> $notes
  73. ## make it commitable
  74. echo -n "Really commit? [no] "
  75. read answer
  76. if [ "$answer" = "y" -o "$answer" = "yes" ]; then
  77. cd src/modules
  78. ./modbuild -m0 cdc web ext_math
  79. cd ../..
  80. ## cvs-fu
  81. tag="GENESIS_${lmajor}_${lminor}_${lpatch}"
  82. cvs commit -m ""
  83. cvs tag $tag
  84. cd ..
  85. mv genesis genesis-work
  86. cvs export -r $tag genesis
  87. else
  88. echo "Ok, just faking it..."
  89. cd ..
  90. fi
  91. mv genesis $nrel
  92. tar -cf "${nrel}.tar" $nrel
  93. gzip -9 "${nrel}.tar"