From e8dc384be9d4bf2b7ed61178c02154dffdb15a9e Mon Sep 17 00:00:00 2001 From: Zachary T Welch Date: Tue, 20 Oct 2009 17:11:33 -0700 Subject: Rewrite release script to use GIT. Update documentation to reflect GIT methodology. Rewrite release.sh script to use appropriate process. With this update, tools/release.sh can be used for producing private release tags on local branches. The documentation still needs work, but their use for v0.3.x should help rectify the deficiences. --- tools/release.sh | 524 ++++++++++++++++--------------------------------------- 1 file changed, 148 insertions(+), 376 deletions(-) (limited to 'tools') diff --git a/tools/release.sh b/tools/release.sh index f1ed4a73..26be1511 100755 --- a/tools/release.sh +++ b/tools/release.sh @@ -7,142 +7,27 @@ #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- -} - -svn_setup_load() { - SVN_ROOT="$(svn_info_get 'Repository Root')" - SVN_URL="$(svn_info_get 'URL')" - - 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 +35,26 @@ Build Commands: build Compiles the project; runs configure, if needed. Packaging Commands: - changelog Generate a new ChangeLog using svn2cl. + changelog Generate a new ChangeLog using ${SCM}2cl. 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() { @@ -213,26 +82,16 @@ maybe_build() { [ -f "src/openocd" ] || do_build; } do_build_clean() { [ -f Makefile ] && make maintainer-clean >/dev/null; } 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 + local CMD=tools/git2cl/git2cl + eval ${CMD} ${OPTS} > ChangeLog } do_changelog_clean() { - do_svn revert ChangeLog + git checkout ChangeLog } do_package() { - package_info_load - maybe_changelog + do_changelog maybe_build echo "Building distribution packages..." make ${MAKE_OPTS} distcheck 2>&1 | perl tools/logger.pl > "release-pkg.log" @@ -266,207 +125,76 @@ do_stage_clean() { rm -v -f -r archives; } do_clean() { do_build_clean do_package_clean - rm -v -f configure - - svn revert configure.in + do_changelog_clean 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}