From 39c0280bf3c68bf49b390b6d9e282d8643e1dfb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Thu, 11 Mar 2010 16:32:37 +0100 Subject: [PATCH] Update script for creating releases to work with Git. --- scripts/create-release.sh | 106 ++++++++++++++++++++++++-------------- 1 file changed, 66 insertions(+), 40 deletions(-) diff --git a/scripts/create-release.sh b/scripts/create-release.sh index ff0201afd..838c0e583 100755 --- a/scripts/create-release.sh +++ b/scripts/create-release.sh @@ -4,36 +4,72 @@ # vim: expandtab sw=4 ts=4 sts=4: # +# Fail on undefined variables +set -u +# Fail on failure +set -e + KITS="all-languages english" COMPRESSIONS="zip-7z tbz tgz 7z" -if [ $# = 0 ] +if [ $# -lt 2 ] then echo "Usages:" - echo " create-release.sh [from_branch]" - echo " (no spaces allowed!)" + echo " create-release.sh " echo "" echo "Examples:" - echo " create-release.sh 2.9.0-rc1 branches/QA_2_9" - echo " create-release.sh 2.9.0 tags/RELEASE_2_9_0" + echo " create-release.sh 2.9.0-rc1 QA_2_9" + echo " create-release.sh 2.9.0 MAINT_2_9_0 TAG" exit 65 fi -branch='trunk' - if [ "$#" -ge 2 ] ; then - branch="$2" - fi - target="$1" - cat <set( 'PMA_VERSION', '$1' ); " + " \$this->set( 'PMA_VERSION', '$version' ); " - in Documentation.html the 2 lines - " phpMyAdmin $1 - Documentation " - "

phpMyAdmin $1 Documentation

" + " phpMyAdmin $version - Documentation " + "

phpMyAdmin $version Documentation

" - in translators.html - in README 2. checked that all language files are valid (use @@ -41,46 +77,36 @@ Please ensure you have: Continue (y/n)? END - read do_release +read do_release - if [ "$do_release" != 'y' ]; then - exit - fi - -# Do SVNcheckout -mkdir -p ./svn -cd svn - -echo "Exporting repository from subversion" - -svn export -q https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/$branch/phpMyAdmin - -if [ $? -ne 0 ] ; then - echo "Subversion checkout failed, bailing out" - exit 2 +if [ "$do_release" != 'y' ]; then + exit 100 fi + # Cleanup release dir -LC_ALL=C date -u > phpMyAdmin/RELEASE-DATE-${target} +LC_ALL=C date -u > RELEASE-DATE-${version} # Building Documentation.txt -LC_ALL=C w3m -dump phpMyAdmin/Documentation.html > phpMyAdmin/Documentation.txt +LC_ALL=C w3m -dump Documentation.html > Documentation.txt # Remove test directory from package to avoid Path disclosure messages # if someone runs /test/wui.php and there are test failures -rm -rf phpMyAdmin/test +rm -rf test -# Renaming directory -mv phpMyAdmin phpMyAdmin-$target +# Remove git metadata +rm -rf .git + +cd .. # Prepare all kits for kit in $KITS ; do # Copy all files - name=phpMyAdmin-$target-$kit - cp -r phpMyAdmin-$target $name + name=phpMyAdmin-$version-$kit + cp -r phpMyAdmin-$version $name # Cleanup translations - cd phpMyAdmin-$target-$kit + cd phpMyAdmin-$version-$kit scripts/lang-cleanup.sh $kit cd .. @@ -123,7 +149,7 @@ for kit in $KITS ; do done # Cleanup -rm -rf phpMyAdmin-${target} +rm -rf phpMyAdmin-${version} echo "" @@ -159,7 +185,7 @@ Todo now: 7. increment rc count or version in subversion : - in libraries/Config.class.php PMA_Config::__constructor() the line - " $this->set( 'PMA_VERSION', '2.7.1-dev' ); " + " \$this->set( 'PMA_VERSION', '2.7.1-dev' ); " - in Documentation.html the 2 lines " phpMyAdmin 2.2.2-rc1 - Documentation " "

phpMyAdmin 2.2.2-rc1 Documentation

"