You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ic...@apache.org on 2021/09/03 11:28:23 UTC
svn commit: r1892852 - in /httpd/dev-tools/v2: common-lib.sh
make-candidate.sh make-tars.sh push-tars.sh
Author: icing
Date: Fri Sep 3 11:28:23 2021
New Revision: 1892852
URL: http://svn.apache.org/viewvc?rev=1892852&view=rev
Log:
* all scripts have a -h option
* make-tars.sh has option "-s user" to specify the pgp/gpg siging user
* push-tars.sh prepares the distribution of the tars for apache.org
- creates/modifies CHANGES and Announcement
- ask for confirmation before "svn commit" of changes
- preps a voting email
Added:
httpd/dev-tools/v2/push-tars.sh
Modified:
httpd/dev-tools/v2/common-lib.sh
httpd/dev-tools/v2/make-candidate.sh
httpd/dev-tools/v2/make-tars.sh
Modified: httpd/dev-tools/v2/common-lib.sh
URL: http://svn.apache.org/viewvc/httpd/dev-tools/v2/common-lib.sh?rev=1892852&r1=1892851&r2=1892852&view=diff
==============================================================================
--- httpd/dev-tools/v2/common-lib.sh (original)
+++ httpd/dev-tools/v2/common-lib.sh Fri Sep 3 11:28:23 2021
@@ -19,6 +19,19 @@ is_int() {
test "$x" = "$1"
}
+ask_yes_no() {
+ if test "${ALWAYS_YES}" = 1; then
+ return 0
+ fi
+ read -r -p "$* [y/N] " response
+ case "$response" in
+ [yY][eE][sS]|[yY])
+ return 0
+ ;;
+ esac
+ return 1
+}
+
# Inspect the local directory and populate
# SVN_URL the absolute url of the local checkout
# SVN_BASE the base url of the project
@@ -177,12 +190,15 @@ create_dist_checksums() {
if ! openssl version >/dev/null; then
fail "unable to find 'openssl' in path"
fi
- for file in "$@"; do
+ for path in "$@"; do
+ pushd `dirname "$path"` >/dev/null
+ file=`basename "$path"`
echo " - create checksums for ${file}"
openssl md5 ${file} | sed -e 's#^MD5(\(.*\))= \([0-9a-f]*\)$#\2 *\1#' > ${file}.md5
openssl sha1 ${file} | sed -e 's#^SHA1(\(.*\))= \([0-9a-f]*\)$#\2 *\1#' > ${file}.sha1
openssl sha256 ${file} | sed -e 's#^SHA256(\(.*\))= \([0-9a-f]*\)$#\2 *\1#' > ${file}.sha256
openssl sha512 ${file} | sed -e 's#^SHA512(\(.*\))= \([0-9a-f]*\)$#\2 *\1#' > ${file}.sha512
+ popd > /dev/null
done
}
Modified: httpd/dev-tools/v2/make-candidate.sh
URL: http://svn.apache.org/viewvc/httpd/dev-tools/v2/make-candidate.sh?rev=1892852&r1=1892851&r2=1892852&view=diff
==============================================================================
--- httpd/dev-tools/v2/make-candidate.sh (original)
+++ httpd/dev-tools/v2/make-candidate.sh Fri Sep 3 11:28:23 2021
@@ -25,17 +25,26 @@ exit_on_warnings=0
usage () {
cat <<EOF 1>&2
-usage: $0 [version]
- create a release candidate in local SVN checkout. With
- version in format 'm.n.p' the semantic version is major, minor and patch number.
-
-WARNING: The directory './dist/release-\${version}' will be purged if it exists
+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
EOF
exit 1
}
source `dirname $0`/common-lib.sh
+while getopts "h" opt; do
+ case $opt in
+ h) usage
+ ;;
+ esac
+done
+
detect_checkout
detect_version $1
Modified: httpd/dev-tools/v2/make-tars.sh
URL: http://svn.apache.org/viewvc/httpd/dev-tools/v2/make-tars.sh?rev=1892852&r1=1892851&r2=1892852&view=diff
==============================================================================
--- httpd/dev-tools/v2/make-tars.sh (original)
+++ httpd/dev-tools/v2/make-tars.sh Fri Sep 3 11:28:23 2021
@@ -21,23 +21,34 @@ set -e
usage () {
cat <<EOF 1>&2
-usage: $0 [version [signing-user]]
- create the release tars from a SVN candidate. The candidate is exported
- to the local dist directory from 'tags/candidate-$version', prepped
- (buildconf, depending srclib, etc.) and then made into tarballs with
- checksums and signatures.
- Options:
+usage: $0 [options] [version]
+ create the release tars from a SVN candidate. The candidate is expected
+ to be found in SVN at 'tags/candidate-$version', as prepared by the
+ 'make-candidate.sh' script.
+ If no version is given, the current version in the checkout is used.
+ Arguments:
version as 'm.n.p(-suffix)?', the version to use.
- signing-user the gpg2/gpg/pgp identity used for signing
+ Options:
+ -h print usage information
+ -s sign-user use gpg/pgp key from 'sign-user'
EOF
exit 1
}
source `dirname $0`/common-lib.sh
+signing_user=
+while getopts "hy" opt; do
+ case $opt in
+ h) usage
+ ;;
+ s) signing_user="$OPTARG"
+ ;;
+ esac
+done
+
detect_checkout
detect_version $1
-signing_user=$2
PROJECT=`basename $SVN_BASE`
SVN_DEST="tags/candidate-${VERSION}"
Added: httpd/dev-tools/v2/push-tars.sh
URL: http://svn.apache.org/viewvc/httpd/dev-tools/v2/push-tars.sh?rev=1892852&view=auto
==============================================================================
--- httpd/dev-tools/v2/push-tars.sh (added)
+++ httpd/dev-tools/v2/push-tars.sh Fri Sep 3 11:28:23 2021
@@ -0,0 +1,155 @@
+#!/bin/sh
+
+# Push candidate release tarballs in directory to the dev or release dist repos
+#
+# USAGE: push.sh directory version dev|dist (scratch_dir)
+# directory: Directory to obtain release artifacts from
+# version: x.y.z (example 2.4.38)
+# dev|dist: If "dev", push to https://dist.apache.org/repos/dist/dev/httpd/
+# If "dist", push to https://dist.apache.org/repos/dist/release/httpd
+# scratch_dir: Optional directory to use as the SVN clone and staging location.
+# Will be created and deleted automatically by this script
+
+#Useful for debugging
+#set -x
+
+#Bail when non-zero return codes are encountered
+set -e
+
+#Make sure English is used when formating dates
+export LANG=en_US.UTF-8
+
+usage () {
+ cat <<EOF 1>&2
+usage: $0 [options] [version]
+ publish the release candidate tars in the dist SVN. The tars need
+ to exist in the local 'dist' directory (created by make-tars.sh).
+ 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
+}
+
+source `dirname $0`/common-lib.sh
+
+while getopts "hy" opt; do
+ case $opt in
+ h) usage
+ ;;
+ y) ALWAYS_YES=1
+ ;;
+ esac
+done
+
+detect_checkout
+detect_version $1
+
+PROJECT=`basename $SVN_BASE`
+SVN_DEST="tags/candidate-${VERSION}"
+
+DIST_DIR="dist"
+SVN_DIST_URL=https://dist.apache.org/repos/dist/
+EXP_DIRNAME="${PROJECT}-${VERSION}"
+EXP_PATH="${DIST_DIR}/${EXP_DIRNAME}"
+
+test -d "${EXP_PATH}" ||
+ fail "export directory ${EXP_PATH} does not exist. Did you run 'make-tars.sh'?"
+test -f "${EXP_PATH}.tar.gz" ||
+ fail "export tarball ${EXP_PATH}.tar.gz does not exist. Did you run 'make-tars.sh'?"
+
+#Ensure scratch space is in a state we are ready to work with
+AO_DIST_PATH="dist/apache.org-dist"
+rm -rf "${AO_DIST_PATH}"
+
+AO_DIST_DEV_PATH="${AO_DIST_PATH}/dev/${PROJECT}"
+AO_DIST_RELEASE_PATH="${AO_DIST_PATH}/release/${PROJECT}"
+
+# SVN repository is huge, carefully check out only what we need
+echo "checking out dist from ${SVN_DIST_URL} ..."
+svn checkout --depth=empty "$SVN_DIST_URL" "${AO_DIST_PATH}" >/dev/null
+echo "checking out ${AO_DIST_DEV_PATH} ..."
+svn update --set-depth immediates --parents "${AO_DIST_DEV_PATH}" >/dev/null
+echo "checking out ${AO_DIST_RELEASE_PATH} ..."
+svn update --set-depth immediates --parents "${AO_DIST_RELEASE_PATH}" >/dev/null
+
+echo "updating CHANGES_${v_major}.${v_minor}.*"
+##Remove existing version-specific CHANGES files
+if ls "${AO_DIST_DEV_PATH}"/CHANGES_${v_major}.${v_minor}.* >/dev/null 2>&1;then
+ svn rm "${AO_DIST_DEV_PATH}"/CHANGES_${v_major}.${v_minor}.*
+fi
+
+## Generate a new version-specific CHANGES file
+#Clever shell tricks... allow the shell to expand the unknown version.
+#If CURRENT is not this branch, this will not trigger a failure from `set -e`
+if test -f "${AO_DIST_RELEASE_PATH}"/CURRENT-IS-${v_major}.${v_minor}*;then
+ latest_release=`ls "${AO_DIST_RELEASE_PATH}"/CURRENT-IS-${v_major}.${v_minor}.* | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+'`
+#Current is not defined for this branch. Use sort to guess
+else
+ latest_release=`ls "${AO_DIST_RELEASE_PATH}"/${PROJECT}-${v_major}.${v_minor}.*.tar.gz | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+' | sort -r | head -1`
+fi
+
+#Delete all lines after the current release
+cat "${EXP_PATH}/CHANGES" | perl -e '
+ while(<STDIN>){
+ $d=1 if /Changes with Apache '$latest_release'/;
+ print if !$d;
+ }' > "${AO_DIST_DEV_PATH}/CHANGES_$VERSION"
+svn add "${AO_DIST_DEV_PATH}/CHANGES_$VERSION" >/dev/null
+
+#Place the tarballs and add to changeset
+echo "adding candidate tars from ${EXP_PATH}*.tar.*"
+cp "${EXP_PATH}"*.tar.* "${AO_DIST_DEV_PATH}"/
+svn add "${AO_DIST_DEV_PATH}"/${EXP_DIRNAME}*.tar.* >/dev/null
+
+echo "updating CHANGES_${v_major}.${v_minor}"
+RELEASE_LINE_CHANGES="${AO_DIST_DEV_PATH}/CHANGES_${v_major}.${v_minor}"
+if test -f "${RELEASE_LINE_CHANGES}";then
+ cp "${EXP_PATH}/CHANGES" "${RELEASE_LINE_CHANGES}"
+else
+ cp "${EXP_PATH}/CHANGES" "${RELEASE_LINE_CHANGES}"
+ svn add "${RELEASE_LINE_CHANGES}" >/dev/null
+fi
+
+echo "updating Announcement${v_major}.${v_minor}.*"
+#Prep announcement files with latest version
+perl -pi -e "s/$v_major\.$v_minor\.\d+/$VERSION/g" \
+ "${AO_DIST_DEV_PATH}"/Announcement${v_major}.${v_minor}.*
+
+today=` date +"%Y-%m-%d"`
+perl -pi -e 's/^(\s+Published ).*$/${1}'"${today}"'/g' \
+ "${AO_DIST_DEV_PATH}"/Announcement${v_major}.${v_minor}.*
+
+#Push changes up to dev
+echo "changes ready for commit in ${AO_DIST_DEV_PATH}"
+svn stat "${AO_DIST_DEV_PATH}"
+if ask_yes_no "Do you want to commit these?"; then
+ svn commit -m "Add $VERSION files" "${AO_DIST_DEV_PATH}"
+fi
+
+pushd ${DIST_DIR} > /dev/null
+TAR_SIGS=`grep '^' httpd-2.4.49.tar.gz.sha* | sed -e 's/.*.tar.gz.//g' -e 's/:/: /g'`
+popd >/dev/null
+
+cat <<EOF > "${DIST_DIR}/mail-vote-$VERSION.txt"
+Subject: [VOTE] Release httpd-$VERSION
+
+Hi, all;
+ Please find below the proposed release tarball and signatures:
+${SVN_DIST_URL}dev/${PROJECT}/
+
+I would like to call a VOTE over the next few days to release this candidate tarball as $VERSION:
+[ ] +1: It's not just good, it's good enough!
+[ ] +0: Let's have a talk.
+[ ] -1: There's trouble in paradise. Here's what's wrong.
+
+The computed digests of the tarball up for vote are:
+${TAR_SIGS}
+
+The SVN candidate source is found at ${SVN_DEST}.
+EOF
+echo "An announcement email template has been created at ${DIST_DIR}/mail-vote-$VERSION.txt"
+cat "${DIST_DIR}/mail-vote-$VERSION.txt"
\ No newline at end of file
Re: svn commit: r1892852 - in /httpd/dev-tools/v2: common-lib.sh
make-candidate.sh make-tars.sh push-tars.sh
Posted by "stefan@eissing.org" <st...@eissing.org>.
> Am 03.09.2021 um 13:46 schrieb Ruediger Pluem <rp...@apache.org>:
>
>
>
> On 9/3/21 1:28 PM, icing@apache.org wrote:
>> Author: icing
>> Date: Fri Sep 3 11:28:23 2021
>> New Revision: 1892852
>>
>> URL: http://svn.apache.org/viewvc?rev=1892852&view=rev
>> Log:
>> * all scripts have a -h option
>> * make-tars.sh has option "-s user" to specify the pgp/gpg siging user
>> * push-tars.sh prepares the distribution of the tars for apache.org
>> - creates/modifies CHANGES and Announcement
>> - ask for confirmation before "svn commit" of changes
>> - preps a voting email
>>
>>
>> Added:
>> httpd/dev-tools/v2/push-tars.sh
>> Modified:
>> httpd/dev-tools/v2/common-lib.sh
>> httpd/dev-tools/v2/make-candidate.sh
>> httpd/dev-tools/v2/make-tars.sh
>>
>
>>
>> Modified: httpd/dev-tools/v2/make-tars.sh
>> URL: http://svn.apache.org/viewvc/httpd/dev-tools/v2/make-tars.sh?rev=1892852&r1=1892851&r2=1892852&view=diff
>> ==============================================================================
>> --- httpd/dev-tools/v2/make-tars.sh (original)
>> +++ httpd/dev-tools/v2/make-tars.sh Fri Sep 3 11:28:23 2021
>> @@ -21,23 +21,34 @@ set -e
>>
>> usage () {
>> cat <<EOF 1>&2
>> -usage: $0 [version [signing-user]]
>> - create the release tars from a SVN candidate. The candidate is exported
>> - to the local dist directory from 'tags/candidate-$version', prepped
>> - (buildconf, depending srclib, etc.) and then made into tarballs with
>> - checksums and signatures.
>> - Options:
>> +usage: $0 [options] [version]
>> + create the release tars from a SVN candidate. The candidate is expected
>> + to be found in SVN at 'tags/candidate-$version', as prepared by the
>> + 'make-candidate.sh' script.
>> + If no version is given, the current version in the checkout is used.
>> + Arguments:
>> version as 'm.n.p(-suffix)?', the version to use.
>> - signing-user the gpg2/gpg/pgp identity used for signing
>> + Options:
>> + -h print usage information
>> + -s sign-user use gpg/pgp key from 'sign-user'
>> EOF
>> exit 1
>> }
>>
>> source `dirname $0`/common-lib.sh
>>
>> +signing_user=
>> +while getopts "hy" opt; do
>
> Shouldn't this be hs instead of hy ?
Keen eyes! Yes, will fix, thanks.
>> + case $opt in
>> + h) usage
>> + ;;
>> + s) signing_user="$OPTARG"
>> + ;;
>> + esac
>> +done
>> +
>> detect_checkout
>> detect_version $1
>> -signing_user=$2
>>
>> PROJECT=`basename $SVN_BASE`
>> SVN_DEST="tags/candidate-${VERSION}"
>>
>
>
> Regards
>
> RĂ¼diger
Re: svn commit: r1892852 - in /httpd/dev-tools/v2: common-lib.sh
make-candidate.sh make-tars.sh push-tars.sh
Posted by Ruediger Pluem <rp...@apache.org>.
On 9/3/21 1:28 PM, icing@apache.org wrote:
> Author: icing
> Date: Fri Sep 3 11:28:23 2021
> New Revision: 1892852
>
> URL: http://svn.apache.org/viewvc?rev=1892852&view=rev
> Log:
> * all scripts have a -h option
> * make-tars.sh has option "-s user" to specify the pgp/gpg siging user
> * push-tars.sh prepares the distribution of the tars for apache.org
> - creates/modifies CHANGES and Announcement
> - ask for confirmation before "svn commit" of changes
> - preps a voting email
>
>
> Added:
> httpd/dev-tools/v2/push-tars.sh
> Modified:
> httpd/dev-tools/v2/common-lib.sh
> httpd/dev-tools/v2/make-candidate.sh
> httpd/dev-tools/v2/make-tars.sh
>
>
> Modified: httpd/dev-tools/v2/make-tars.sh
> URL: http://svn.apache.org/viewvc/httpd/dev-tools/v2/make-tars.sh?rev=1892852&r1=1892851&r2=1892852&view=diff
> ==============================================================================
> --- httpd/dev-tools/v2/make-tars.sh (original)
> +++ httpd/dev-tools/v2/make-tars.sh Fri Sep 3 11:28:23 2021
> @@ -21,23 +21,34 @@ set -e
>
> usage () {
> cat <<EOF 1>&2
> -usage: $0 [version [signing-user]]
> - create the release tars from a SVN candidate. The candidate is exported
> - to the local dist directory from 'tags/candidate-$version', prepped
> - (buildconf, depending srclib, etc.) and then made into tarballs with
> - checksums and signatures.
> - Options:
> +usage: $0 [options] [version]
> + create the release tars from a SVN candidate. The candidate is expected
> + to be found in SVN at 'tags/candidate-$version', as prepared by the
> + 'make-candidate.sh' script.
> + If no version is given, the current version in the checkout is used.
> + Arguments:
> version as 'm.n.p(-suffix)?', the version to use.
> - signing-user the gpg2/gpg/pgp identity used for signing
> + Options:
> + -h print usage information
> + -s sign-user use gpg/pgp key from 'sign-user'
> EOF
> exit 1
> }
>
> source `dirname $0`/common-lib.sh
>
> +signing_user=
> +while getopts "hy" opt; do
Shouldn't this be hs instead of hy ?
> + case $opt in
> + h) usage
> + ;;
> + s) signing_user="$OPTARG"
> + ;;
> + esac
> +done
> +
> detect_checkout
> detect_version $1
> -signing_user=$2
>
> PROJECT=`basename $SVN_BASE`
> SVN_DEST="tags/candidate-${VERSION}"
>
Regards
RĂ¼diger