home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 June / ENTER.ISO / files / xampp-win32-1.4.5-installer.exe / xampp / create-release.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  2004-06-08  |  6.4 KB  |  257 lines

  1. #!/bin/sh
  2. #
  3. # $Id: create-release.sh,v 2.4.2.3 2004/06/08 22:16:25 rabus Exp $
  4. #
  5. # 2004-06-07  rabus@users.sourceforge.net
  6. # - create backup config file
  7. #
  8. # 2004-04-29, lem9@users.sourceforge.net:
  9. # - keep only the previous cvs directory created
  10. #
  11. # 2004-04-16, lem9@users.sourceforge.net:
  12. # - daily snapshot when called with first parameter "snapshot"
  13. # - remove directory used for the checkout
  14. #
  15. # 2003-11-18, nijel@users.sourceforge.net:
  16. # - switch php3 -> php
  17. #
  18. # 2003-10-10, nijel@users.sourceforge.net:
  19. # - cvsserver set on just one place to ease testing
  20. # - echoes md5 sums to include on download page
  21. #
  22. # 2003-06-22, robbat2@users.sourceforge.net:
  23. # - Moved to using updatedocs.sh for updating documentation
  24. # - Make tarring faster by re-arranging ops
  25. #
  26. # 2003-01-17, rabus@users.sourceforge.net:
  27. # - Changed the CVS hostname to cvs1 because cvs1.sourceforge.net is now blocked
  28. #   for the SF shell servers, too. Note: The script now works on the SF shell
  29. #   servers ONLY!
  30. #
  31. # 2002-11-22, rabus@users.sourceforge.net:
  32. # - changed the CVS server dns to cvs1.sourceforge.net
  33. #   (cvs.phpmyadmin.sourceforge.net does not work at the SF shell anymore).
  34. #
  35. # 2002-10-03, rabus@users.sourceforge.net:
  36. # - more detailed instructions
  37. #
  38. # 2002-09-08, robbat2@users.sourceforge.net:
  39. # - Tweaked final instruction list
  40. #
  41. # 2002-06-17, lem9@users.sourceforge.net:
  42. # - I option to tar for bzip2 is deprecated, use j
  43. #
  44. # 2002-27-04, loic@phpmyadmin.net:
  45. # - added the cvs branch feature
  46. #
  47. # 2001-08-08, swix@users.sourceforge.net:
  48. # - created script
  49. # - added release todo list
  50. #
  51.  
  52. cvsserver=cvs1
  53.  
  54. if [ $# == 0 ]
  55. then
  56.   echo "Usage: create-release.sh version from_branch"
  57.   echo "  (no spaces allowed!)"
  58.   echo ""
  59.   echo "Example: create-release.sh 2.2.7-rc1 v2_2_7-branch"
  60.   exit 65
  61. fi
  62.  
  63. if [ $# == 1 ]
  64. then
  65.   branch=''
  66. fi
  67. if [ $# == 2 ]
  68. then
  69.   branch="-r $2"
  70. fi
  71.  
  72. if [ $1 == "snapshot" ]
  73. then
  74.   mode="snapshot"
  75.   date_snapshot=`date +%Y%m%d-%H%M%S`
  76. fi
  77.  
  78. # Set target name
  79. if [ "$mode" != "snapshot" ]
  80. then
  81.  target=$1
  82. else
  83.  target=$date_snapshot
  84. fi
  85.  
  86.  
  87. if [ "$mode" != "snapshot" ]
  88. then
  89.  
  90.  cat <<END
  91.  
  92. Please ensure you have:
  93.   1. incremented rc count or version in CVS :
  94.      - in libraries/defines.lib.php the line
  95.           " define('PMA_VERSION', '$1'); "
  96.      - in Documentation.html the 2 lines
  97.           " <title>phpMyAdmin $1 - Documentation</title> "
  98.           " <h1>phpMyAdmin $1 Documentation</h1> "
  99.      - in translators.html
  100.      - in README
  101.   2. synchronized the language files:
  102.        cd lang
  103.        ./sync_lang.sh
  104.      and checked all language files are valid (use
  105.      the "./scripts/check_lang.php" script to do it).
  106.  
  107. Continue (y/n)?
  108. END
  109.  printf "\a"
  110.  read do_release
  111.  
  112.  if [ "$do_release" != 'y' ]; then
  113.    exit
  114.  fi
  115. fi
  116.  
  117. # Goto project dir
  118. cd /home/groups/p/ph/phpmyadmin/htdocs
  119.  
  120. ## Move old cvs dir
  121. #if [ -e cvs ];
  122. #then
  123. #    mv cvs cvs-`date +%s`
  124. #fi
  125.  
  126. # Keep one previous version of the cvs directory
  127. if [ -e cvs-prev ];
  128. then
  129.     rm -rf cvs-prev
  130. fi
  131. mv cvs cvs-prev
  132.  
  133. # Do CVS checkout
  134. mkdir cvs
  135. cd cvs
  136.  
  137. if [ "$mode" != "snapshot" ]
  138. then
  139.  echo "Press [ENTER]!"
  140.  cvs -q -d:pserver:anonymous@$cvsserver:/cvsroot/phpmyadmin login
  141.  if [ $? -ne 0 ] ; then
  142.      echo "CVS login failed, bailing out"
  143.      exit 1
  144.  fi
  145. fi
  146.  
  147. cvs -q -z3 -d:pserver:anonymous@$cvsserver:/cvsroot/phpmyadmin co -P $branch phpMyAdmin
  148.  
  149. if [ $? -ne 0 ] ; then
  150.     echo "CVS checkout failed, bailing out"
  151.     exit 2
  152. fi
  153.  
  154. # Cleanup release dir
  155. LC_ALL=C date -u > phpMyAdmin/RELEASE-DATE-${target}
  156.  
  157. # Olivier asked to keep those in the cvs release, to allow testers to use
  158. # cvs update on it
  159. if [ "$mode" != "snapshot" ]
  160. then
  161.  find phpMyAdmin \( -name .cvsignore -o -name CVS \) -print0 | xargs -0 rm -rf
  162. fi
  163.  
  164. find phpMyAdmin -type d -print0 | xargs -0 chmod 755
  165. find phpMyAdmin -type f -print0 | xargs -0 chmod 644
  166. find phpMyAdmin \( -name '*.sh' -o -name '*.pl' \) -print0 | xargs -0 chmod 755
  167.  
  168. # Building Documentation.txt
  169. lynx --dont_wrap_pre --nolist --dump phpMyAdmin/Documentation.html > phpMyAdmin/Documentation.txt
  170.  
  171. # Creating a backup config.inc.php
  172. cp phpMyAdmin/config.inc.php phpMyAdmin/config.default
  173.  
  174. # Renaming directory
  175.  mv phpMyAdmin phpMyAdmin-$target
  176.  
  177. # Building distribution kits
  178. zip -9 -r phpMyAdmin-${target}.zip phpMyAdmin-${target}
  179. tar cvf phpMyAdmin-${target}.tar phpMyAdmin-${target}
  180. bzip2 -9kv phpMyAdmin-${target}.tar
  181. gzip -9v phpMyAdmin-${target}.tar
  182.  
  183. # Cleanup
  184. rm -rf phpMyAdmin-${target}
  185.  
  186. if [ "$mode" != "snapshot" ]
  187. then
  188.  
  189.  
  190. echo ""
  191. echo ""
  192. echo ""
  193. echo "Files:"
  194. echo "------"
  195.  
  196. ls -la *.gz *.zip *.bz2
  197.  
  198. echo
  199. echo "MD5 sums:"
  200. echo "--------"
  201.  
  202. md5sum *.{gz,zip,bz2} | sed "s/\([^ ]*\)[ ]*\([^ ]*\)/\$md5sum['\2'] = '\1';/"
  203.  
  204. echo
  205. echo "Sizes:"
  206. echo "------"
  207.  
  208. ls -l --block-size=k *.{gz,zip,bz2} | sed -r "s/[a-z-]+[[:space:]]+[0-9]+[[:space:]]+[^[:space:]]+[[:space:]]+[^[:space:]]+[[:space:]]+([0-9]*)K.*[[:space:]]([^[:space:]]+)\$/\$size['\2'] = \1;/"
  209.  
  210. echo
  211. echo "Add these to /home/groups/p/ph/phpmyadmin/htdocs/home_page/files.inc.php on sf"
  212.  
  213. cat <<END
  214.  
  215.  
  216. Todo now:
  217. ---------
  218.  1. tag the cvs tree with the new revision number for a plain release or a
  219.     release candidate
  220.  2. upload the files to SF:
  221.         ftp upload.sourceforge.net
  222.         cd incoming
  223.         binary
  224.         mput cvs/*.gz *.zip *.bz2
  225.  3. add files to SF files page (cut and paste changelog since last release)
  226.  4. add SF news item to phpMyAdmin project
  227.  5. update web page:
  228.         - add MD5s and file sizes to /home/groups/p/ph/phpmyadmin/htdocs/home_page/files.inc.php
  229.         - add release to /home/groups/p/ph/phpmyadmin/htdocs/home_page/config.inc.php
  230.  6. announce release on freshmeat (http://freshmeat.net/projects/phpmyadmin/)
  231.  7. send a short mail (with list of major changes) to
  232.         phpmyadmin-devel@lists.sourceforge.net
  233.         phpmyadmin-news@lists.sourceforge.net
  234.         phpmyadmin-users@lists.sourceforge.net
  235.  8. increment rc count or version in CVS :
  236.         - in libraries/defines.lib.php the line
  237.               " define('PHPMYADMIN_VERSION', '2.2.2-rc1'); "
  238.         - in Documentation.html the 2 lines
  239.               " <title>phpMyAdmin 2.2.2-rc1 - Documentation</title> "
  240.               " <h1>phpMyAdmin 2.2.2-rc1 Documentation</h1> "
  241.         - in translators.html
  242.  9. the end :-)
  243.  
  244. END
  245.  
  246. fi
  247.  
  248. cd ..
  249. find cvs -type d -print0 | xargs -0 chmod 775
  250. find cvs -type f -print0 | xargs -0 chmod 664
  251.  
  252. # Removed due to not needed thanks to clever scripting by Robbat2
  253. # 9. update the demo subdirectory:
  254. #        - in htdocs, cvs update phpMyAdmin
  255. #        - and don't forget to give write rights for the updated scripts to the
  256. #          whole group
  257.