X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=tools%2Frelease.sh;h=c464c49f72f0dabf6961199d7db6b10230e41996;hp=c1f7f7c221d408fbc5508fba911cfc7a115db2ca;hb=16f485aca2193b06d182ab30dd5afe36826e92b5;hpb=7b9f01e0ae1e4e36dd61a3e547a68b9271206caa diff --git a/tools/release.sh b/tools/release.sh index c1f7f7c221..c464c49f72 100755 --- a/tools/release.sh +++ b/tools/release.sh @@ -1,148 +1,35 @@ -#!/bin/sh -e +#!/bin/bash # release.sh: openocd release process automation # Copyright (C) 2009 by Zachary T Welch # Release under the GNU GPL v2 (or later versions). +# FIXME Remove more bash-isms. Fix errors making "ash -e" lose. + ## set these to control the build process #CONFIG_OPTS="" #MAKE_OPTS="" -## DO NOT PERFORM LIVE RELEASES UNLESS YOU ARE THE RELEASE MANAGER!!! -RELEASE_DRY_RUN=1 -## set this to perform individual steps on past releases -RELEASE_VERSION= - -die() { - echo "$@" >&2 - exit 1 -} - -svn_info_get() { - svn info | grep "$1" | cut -d':' -f2- | cut -c2- -} +## specifies the --next release type: major, minor, micro, rc, tag +#RELEASE_TYPE=tag +## For tag release type, specifies the name of the tag (e.g. "foo"). +## The default is the current user name, as found by the 'id' command. +#RELEASE_TAG="$(id -un)" -svn_setup_load() { - SVN_ROOT="$(svn_info_get 'Repository Root')" - SVN_URL="$(svn_info_get 'URL')" +. "tools/release/helpers.sh" - SVN_TRUNK="${SVN_ROOT}/trunk" - - SVN_BRANCHES="${SVN_ROOT}/branches" - PACKAGE_BRANCH="${SVN_BRANCHES}/${PACKAGE_RELEASE}" - - SVN_TAGS="${SVN_ROOT}/tags" - PACKAGE_TAG="${SVN_TAGS}/${PACKAGE_RELEASE}" - - if [ "${SVN_URL}" = "${SVN_TRUNK}" ]; then - RELEASE_TYPE=minor - elif [ "${SVN_URL/${SVN_BRANCHES}/}" != "${SVN_URL}" ]; then - RELEASE_TYPE=micro - else - echo "error: bad URL: ${SVN_URL}" >&2 - die "unable to branch from the current location" - fi -} -svn_setup_show() { - cat < +usage: $0 ... +Command Options: + --next name The branch's next release type: major, minor, micro, rc, tag. + --next-tag name The name for the package version tag. + --live Perform the actions in the repository. Main Commands: info Show a summary of the next pending release. release Release the current tree as an archive. - upload Upload archives to berliOS project site Build Commands: bootstrap Prepare the working copy for configuration and building. @@ -150,42 +37,25 @@ Build Commands: build Compiles the project; runs configure, if needed. Packaging Commands: - changelog Generate a new ChangeLog using svn2cl. package Produce new distributable source archives. stage Move archives to staging area for upload. -Repository Commands: - commit Perform branch and tag, as appropriate for the version. - branch Create a release branch from the project trunk. - tag Create a tag for the current release branch. - Other Commands: - version ... Perform version number and tag manipulations. - maryslamb Mary had a little lamb, but no one noticed. clean Forces regeneration of results. clean_all Removes all traces of the release process. help Provides this list of commands. - + For more information about this script, see the Release Processes page in the OpenOCD Developer's Manual (doc/manual/release.txt). - -WARNING: This script should be used by the Release Manager ONLY. USAGE exit 0 } do_usage() { usage; } do_help() { usage; } -do_info_show() { +do_info() { echo "Current Release Analysis:" package_info_show - svn_setup_show -} - -do_info() { - package_info_load - svn_setup_load - do_info_show } do_bootstrap() { @@ -212,40 +82,8 @@ do_build() { maybe_build() { [ -f "src/openocd" ] || do_build; } do_build_clean() { [ -f Makefile ] && make maintainer-clean >/dev/null; } -maybe_rebuild() { - if [ -f "configure" ]; then - echo "Re-running autoconf..." - autoconf - echo "Re-running automake..." - automake - fi - if [ -f "Makefile" ]; then - do_configure - do_build - fi -} - -do_changelog() { - echo "Updating working copy to HEAD..." - do_svn update - echo "Creating ChangeLog..." - svn2cl -i --authors AUTHORS.ChangeLog -} -maybe_changelog() { - if [ -z "${RELEASE_DRY_RUN}" ] \ - || [ ! -f ChangeLog ] \ - || [ "$(cat ChangeLog | wc -l)" -lt 2 ] - then - do_changelog - fi -} -do_changelog_clean() { - do_svn revert ChangeLog -} do_package() { - package_info_load - maybe_changelog maybe_build echo "Building distribution packages..." make ${MAKE_OPTS} distcheck 2>&1 | perl tools/logger.pl > "release-pkg.log" @@ -272,198 +110,86 @@ do_stage() { mv -v "${FILE}" archives/ done cp -a NEWS archives/ - cp -a ChangeLog archives/ } do_stage_clean() { rm -v -f -r archives; } do_clean() { do_build_clean do_package_clean - rm -v -f configure - - svn revert configure.in rm -v -f release-*.log } do_clean_all() { do_clean - do_changelog_clean do_stage_clean } -do_version_usage() { - cat << USAGE -usage: $0 version -Version Commands: - tag {add|remove}