You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by co...@apache.org on 2023/04/13 01:24:46 UTC
svn commit: r1909108 - in /apr/site/trunk/tools: README.md common-lib.sh r0-make-candidate.sh release.sh
Author: covener
Date: Thu Apr 13 01:24:46 2023
New Revision: 1909108
URL: http://svn.apache.org/viewvc?rev=1909108&view=rev
Log:
improve & move instructions out of release.sh
port "step 0" from httpd for the tagging
change copyright and DEV_VERSION stuff in the tag.
Added:
apr/site/trunk/tools/README.md
apr/site/trunk/tools/r0-make-candidate.sh (with props)
Modified:
apr/site/trunk/tools/common-lib.sh
apr/site/trunk/tools/release.sh
Added: apr/site/trunk/tools/README.md
URL: http://svn.apache.org/viewvc/apr/site/trunk/tools/README.md?rev=1909108&view=auto
==============================================================================
--- apr/site/trunk/tools/README.md (added)
+++ apr/site/trunk/tools/README.md Thu Apr 13 01:24:46 2023
@@ -0,0 +1,46 @@
+# APR/APU release process
+
+## 1) Release basics
+1. set APR_DEV_TOOLS to the parent directory of this readme, e.g. APR_DEV_TOOLS=$HOME/SRC/apr-site/tools
+2. set your working directory to a clean checkout of the project you're releasing
+3. Tag an rc:
+
+ ```
+ $APR_DEV_TOOLS/r0-make-candidate.sh rc1
+ ```
+4. cd $APR_DEV_TOOLS and read/run release.sh pointing to the tag created
+ by r0-make-candidate.sh.
+5. Add the generated tarballs, sigs, checksums, etc to checkout of https://dist.apache.org/repos/dist/dev/apr
+ - XXX: Need to borrow automation from httpd-dev-tools/release
+6. Announce the vote w/ the links to dist/dev/apr
+7. Wait for results and repeat or release
+8. If unsuccessful, cleanup https://dist.apache.org/repos/dist/dev/apr and repeat with a later rcX.
+9. On successful release
+ 1. rename the tag to drop the -rcX-candidate suffix
+ 2. rename the files to drop the -rxX suffix
+ 3. svn mv them from dist/dev/ to dist/release
+ - wait for dlcdn links (immediate) and directory listings (up to 2 hours) to show the new files.
+ - update the Announcement txt and html on dist/dev and copy it.
+ - update the download and index xdocs/ as in r1840948
+ 4. Update CHANGES-* on dist/release/apr
+ e.g. https://www.apache.org/dist/apr/CHANGES-APR-1.7
+ 5. Send announce emails to apr and announce@ (see r6-announce.sh in this dir)
+
+## 2) If there were CVES
+
+1. set CVEs to READY on the cveprocess site
+ - Use the 'OSS/ASF Emails' tab for the emails you should send to oss-security
+ and to Apache lists.
+ - Fill in a 'reference' tag 'vendor-advisory' with the URL to your public post about
+ this issue (the same emails ent in the preceding sub-bullet(
+ - ASF Security will be notified and will submit to the CVE
+ project and then set state to 'PUBLIC'.
+2. Add any CVE details if applicable to the CHANGES and commit and copy to dist/apr
+
+## 3) Cleanup
+
+1. Clean up prior release artifacts on dist
+2. Add a new CHANGES banner
+3. Add releases to reporter.apache.org and bz.apache.org
+ https://reporter.apache.org/addrelease.html?apr
+ https://bz.apache.org/bugzilla/editproducts.cgi?action=edit&product=APR
Modified: apr/site/trunk/tools/common-lib.sh
URL: http://svn.apache.org/viewvc/apr/site/trunk/tools/common-lib.sh?rev=1909108&r1=1909107&r2=1909108&view=diff
==============================================================================
--- apr/site/trunk/tools/common-lib.sh (original)
+++ apr/site/trunk/tools/common-lib.sh Thu Apr 13 01:24:46 2023
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/sh -x
#Make sure English is used when formating dates and other things
export LANG=en_US.UTF-8
@@ -106,15 +106,28 @@ detect_version() {
# did we record it already?
if test -f "${DIST_DIR}/VERSION"; then
source "${DIST_DIR}/VERSION"
- elif test -f include/ap_release.h; then
+ elif test -f include/apr_version.h; then
# determine version from local files
- v_major=`grep -E '#define\sAP_SERVER_MAJORVERSION_NUMBER' include/ap_release.h | awk '{print $3}'`
- v_minor=`grep -E '#define\sAP_SERVER_MINORVERSION_NUMBER' include/ap_release.h | awk '{print $3}'`
- v_patch=`grep -E '#define\sAP_SERVER_PATCHLEVEL_NUMBER' include/ap_release.h | awk '{print $3}'`
+ v_major=`grep -E '#define\sAPR_MAJOR_VERSION' include/apr_version.h | awk '{print $3}'`
+ v_minor=`grep -E '#define\sAPR_MINOR_VERSION' include/apr_version.h | awk '{print $3}'`
+ v_patch=`grep -E '#define\sAPR_PATCH_VERSION' include/apr_version.h | awk '{print $3}'`
+ is_apr=1
+ elif test -f include/apu_version.h; then
+ # determine version from local files
+ v_major=`grep -E '#define\sAPU_MAJOR_VERSION' include/apu_version.h | awk '{print $3}'`
+ v_minor=`grep -E '#define\sAPU_MINOR_VERSION' include/apu_version.h | awk '{print $3}'`
+ v_patch=`grep -E '#define\sAPU_PATCH_VERSION' include/apu_version.h | awk '{print $3}'`
+ is_apr=0
else
fail "unable to determine version in local checkout"
fi
else
+ if test -f include/apr_version.h; then
+ is_apr=1
+ elif test -f include/apu_version.h; then
+ is_apr=0
+ fi
+
v_major=`echo $version | cut -d "." -f 1`
v_minor=`echo $version | cut -d "." -f 2`
#Not currently used in this script, but make it available. Support -alpha, -beta -rcX names here
@@ -130,11 +143,17 @@ detect_version() {
is_int ${v_patch} || fail "version patch '${v_patch}' is not a number"
# double check that our checkout matches the version we detected
- if test -f include/ap_release.h; then
- svn_v_major=`grep -E '#define\sAP_SERVER_MAJORVERSION_NUMBER' include/ap_release.h | awk '{print $3}'`
- svn_v_minor=`grep -E '#define\sAP_SERVER_MINORVERSION_NUMBER' include/ap_release.h | awk '{print $3}'`
+ if [ $is_apr -eq 1 ]; then
+ svn_v_major=`grep -E '#define\sAPR_MAJOR_VERSION' include/apr_version.h | awk '{print $3}'`
+ svn_v_minor=`grep -E '#define\sAPR_MINOR_VERSION' include/apr_version.h | awk '{print $3}'`
+ if test "$v_major" != "$svn_v_major" -o "$v_minor" != "$svn_v_minor"; then
+ fail "detect version ${v_major}.${v_minor} does not match checkout verison ${svn_v_major}.${svn_v_minor}"
+ fi
+ else
+ svn_v_major=`grep -E '#define\sAPU_MAJOR_VERSION' include/apu_version.h | awk '{print $3}'`
+ svn_v_minor=`grep -E '#define\sAPU_MINOR_VERSION' include/apu_version.h | awk '{print $3}'`
if test "$v_major" != "$svn_v_major" -o "$v_minor" != "$svn_v_minor"; then
- fail "detect version ${v_major}.${v_minor} does not match checkout verison ${svn_v_major}.${svn_v_minor}"
+ fail "detect version ${v_major}.${v_minor} does not match checkout verison ${svn_v_major}.${svn_v_minor}"
fi
fi
VERSION="${v_major}.${v_minor}.${v_patch}"
@@ -150,6 +169,7 @@ v_major="${v_major}"
v_minor="${v_minor}"
v_patch="${v_patch}"
v_suffix="${v_suffix}"
+is_apr="${is_apr}"
EOF
}
Added: apr/site/trunk/tools/r0-make-candidate.sh
URL: http://svn.apache.org/viewvc/apr/site/trunk/tools/r0-make-candidate.sh?rev=1909108&view=auto
==============================================================================
--- apr/site/trunk/tools/r0-make-candidate.sh (added)
+++ apr/site/trunk/tools/r0-make-candidate.sh Thu Apr 13 01:24:46 2023
@@ -0,0 +1,154 @@
+#!/bin/sh
+
+# Create a release candidate for voting in a svn checkout
+#
+# USAGE: r0-make-candidate.sh [version]
+# EXAMPLE: r0-make-candidate.sh 1.7.4
+#
+# This script is called in a built svn checkout of the branch for which
+# a release candidate shall be made:
+# @version the version identifier, major.minor.patch, to use. If not given
+# it will determine the version from the local sources
+#
+
+#Useful for debugging
+#set -x
+
+#Bail when non-zero return codes are encountered
+set -e
+
+usage () {
+ cat <<EOF 1>&2
+usage: $0 [options] [version]
+ create a release candidate in local SVN checkout.
+ If no version is given, the current version in the checkout is used.
+ Arguments:
+ version as 'm.n.p(-suffix)?' the version to use.
+ Options:
+ -h print usage information
+ -y never ask, always assume yes
+EOF
+ exit 1
+}
+
+while getopts "hy" opt; do
+ case $opt in
+ h) usage
+ ;;
+ y) ALWAYS_YES=1
+ ;;
+ esac
+done
+shift $((OPTIND-1))
+
+source `dirname $0`/common-lib.sh
+source `dirname $0`/env.sh
+
+detect_checkout
+assure_clean_checkout
+detect_version $1
+
+SVN_DEST="tags/${FULL_VERSION}-candidate"
+DEST_DIR="${DIST_DIR}/${FULL_VERSION}-candidate"
+
+# find out which CVEs are ready and will be reporting in this candidate
+calc_ready_CVE_DIRS "${DIST_DIR}/pmc"
+
+# if a directory of the candidate already exists at pmc/SECURITY
+# something is fishy and we require someone to decide what to fix.
+if test -d "${DIST_DIR}/pmc/SECURITY/${PROJECT}-${FULL_VERSION}"; then
+ cat <<EOF >&2
+${DIST_DIR}/pmc/SECURITY/${PROJECT}-${FULL_VERSION} already exists.
+This indicates that the candidate has already been built before
+and not been fully removed again. Please verify if the version
+number used is correct or if the removal of SECURITY/${PROJECT}-${FULL_VERSION}
+was just omitted by mistake.
+EOF
+ fail "Please correct this and try again."
+fi
+
+cat <<EOF
+creating release candidate:
+ PROJECT: $PROJECT
+ VERSION: $FULL_VERSION
+ URL: $SVN_URL
+ SOURCE: $SVN_SRC@$SVN_REV
+ DEST: $SVN_DEST
+ LOCAL: $DEST_DIR
+ CVEs: ${CVE_DIRS:-none}
+EOF
+if ! ask_yes_no "Is this as expected?"; then
+ exit 1
+fi
+
+if svn ls "$SVN_BASE/$SVN_DEST" >/dev/null 2>&1; then
+ warn "release candidate tag already exists at $SVN_DEST"
+ if ! ask_yes_no "Do you want to continue anyway?"; then
+ exit 1
+ fi
+else
+ echo "creating candidate tag: $SVN_DEST"
+ svn cp -m "Tag $SVN_SRC@$SVN_REV as $FULL_VERSION" "$SVN_BASE/$SVN_SRC@$SVN_REV" "$SVN_BASE/$SVN_DEST"
+ rm -rf "$DEST_DIR"
+fi
+
+if test ! -d "$DEST_DIR"; then
+ mkdir -p `dirname "$DEST_DIR"`
+ echo "checkout $DEST_DIR"
+ svn checkout -q "$SVN_BASE/$SVN_DEST" "$DEST_DIR"
+else
+ echo "updating existing checkout in $DEST_DIR"
+ svn update "$DEST_DIR"
+fi
+
+pushd "$DEST_DIR" >/dev/null
+
+if test -f include/apr_version.h; then
+ echo "setting APR_IS_DEV_VERSION to undef"
+ perl -pi -e 's@^#define APR_IS_DEV_VERSION@/* #undef APR_IS_DEV_VERSION */@' include/apr_version.h
+ if grep -e '^#define APR_IS_DEV_VERSION' include/apr_version.h >/dev/null 2>&1;then
+ fail "implementing change to undef APR_IS_DEV_VERSION failed"
+ fi
+fi
+
+if test -f include/apu_version.h; then
+ echo "setting APU_IS_DEV_VERSION"
+ perl -pi -e 's@^#define APU_IS_DEV_VERSION@/* #undef APU_IS_DEV_VERSION */@' include/apu_version.h
+ if grep -e '^#define APU_IS_DEV_VERSION' include/apu_version.h >/dev/null 2>&1;then
+ fail "implementing change to undef APU_IS_DEV_VERSION failed"
+ fi
+fi
+
+
+# Ensure the Copyright date reflects the current year
+for src in NOTICE include/apr_version.h; do
+ current_year=`date +%Y`
+ if test -f "$src"; then
+ perl -pi -e "s/\d+ The Apache Software/$current_year The Apache Software/g" "$src"
+ fi
+done
+
+popd >/dev/null
+
+echo "changes for ${PROJECT}-${FULL_VERSION} in ${DEST_DIR}"
+svn stat "${DEST_DIR}"
+echo ""
+if ask_yes_no "Do you want to commit these?"; then
+ svn commit -m "Post $FULL_VERSION tag updates" "$DEST_DIR"
+ echo "release candidate sources created in $SVN_DEST"
+ save_version
+
+ if test -n "${CVE_DIRS}"; then
+ echo "Saving CVE information for ${PROJECT}-${FULL_VERSION}"
+ mkdir "${DIST_DIR}/pmc/SECURITY/${PROJECT}-${FULL_VERSION}"
+ pushd "${DIST_DIR}/pmc/SECURITY/${PROJECT}-${FULL_VERSION}"
+ for CVE in $CVE_DIRS; do
+ ln -s ../"${CVE}" "${CVE}"
+ done
+ popd
+ svn add "${DIST_DIR}/pmc/SECURITY/${PROJECT}-${FULL_VERSION}"
+ if ask_yes_no "Do you want to commit these?"; then
+ svn commit -m "CVEs included in ${PROJECT}-${FULL_VERSION}" "${DIST_DIR}/pmc"
+ fi
+ fi
+fi
Propchange: apr/site/trunk/tools/r0-make-candidate.sh
------------------------------------------------------------------------------
svn:executable = *
Modified: apr/site/trunk/tools/release.sh
URL: http://svn.apache.org/viewvc/apr/site/trunk/tools/release.sh?rev=1909108&r1=1909107&r2=1909108&view=diff
==============================================================================
--- apr/site/trunk/tools/release.sh (original)
+++ apr/site/trunk/tools/release.sh Thu Apr 13 01:24:46 2023
@@ -6,12 +6,8 @@
#
# The project is either 'apr', 'apr-util' or 'apr-iconv'
#
-# The TAG is the CVS tag that will be pulled when retreiving the source. If the tag has an -rcX suffix, the packages will too.
-#
-# To prep the tag:
-# 1. Check copyrights as in apr-trunk r1898794
-# 2. Comment out APR_IS_DEV_VERSION as in apr-1.7.x r1906812
-# 3. Copy it with e.g. svn cp -m "tag 1.7.1-rc1" https://svn.apache.org/repos/asf/apr/apr/branches/1.7.x@1906812 https://svn.apache.org/repos/asf/apr/apr/tags/1.7.1-rc1
+# The TAG is the SVN tag that will be pulled when retreiving the source. If the tag has an -rcX suffix, the packages will too.
+# See README.md and r0-make-candidate.sh in this directory.
#
# The RELEASE-VERSION is the name that will be given to the tarball.
# Eg. if RELEASE-VERSION is 5.6.7 then the tarball will be apr-5.6.7.tar.gz
@@ -22,39 +18,9 @@
# The APR-SOURCE is an optional path to the local APR source directory
# required for apr-util's buildconf to find the required files.
#
-#
# This script will run the appropriate commands to prepare and construct the
# tarball. The subdirectory will be cleaned up upon exit.
#
-# What comes after the script?
-# 1. Add the generated tarballs, sigs, checksums, etc to checkout of https://dist.apache.org/repos/dist/dev/apr
-# 2. Announce the vote w/ the links to dist/dev/apr
-# 3. Wait for results and repeat or release
-# 4. To release:
-# 1. rename the tag to drop the -rcX suffix
-# 2. rename the files to drop the -rxX suffix
-# 3. svn mv them from dist/dev/ to dist/release
-# - wait for dlcdn links (immediate) and directory listings (up to 2 hours) to show the new files.
-# - update the Announcement txt and html on dist/dev and copy it.
-# - update the download and index xdocs/ as in r1840948
-# 4. Update CHANGES-* on dist/release/apr
-# e.g. https://www.apache.org/dist/apr/CHANGES-APR-1.7
-# 5. Send announce emails to apr and announce@ (see r6-announce.sh in this dir)
-# # Process the CVEs that have been part of the release:
-# 6. set CVEs to READY on the cveprocess site
-# - Use the 'OSS/ASF Emails' tab for the emails you should send to oss-security
-# and to Apache lists.
-# - Fill in a 'reference' tag 'vendor-advisory' with the URL to your public post about
-# this issue (the same emails ent in the preceding sub-bullet(
-# - ASF Security will be notified and will submit to the CVE
-# project and then set state to 'PUBLIC'.
-# 7. Add any CVE details if applicable to the CHANGES and commit and copy to dist/apr
-# 8. Clean up prior release artifacts
-# 9. restore {APR|APU}_IS_DEV_VERSION define in headers and bump versions. Add a new CHANGES banner
-# 10. Add releases to reporter.apache.org and bz.apache.org
-# https://reporter.apache.org/addrelease.html?apr
-# https://bz.apache.org/bugzilla/editproducts.cgi?action=edit&product=APR
-
if test "$#" != 2 && test "$#" != 3 && test "$#" != 4; then
echo "USAGE: $0 PROJECT TAG [SIGNING-USER] [APR-SOURCE]" >&2
echo " see the comments in this script for more info." >&2