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/16 14:31:24 UTC

svn commit: r1909174 - in /apr/site/trunk/release: common-lib.sh env.sh r0-make-candidate.sh r4-stage-release.sh

Author: covener
Date: Sun Apr 16 14:31:23 2023
New Revision: 1909174

URL: http://svn.apache.org/viewvc?rev=1909174&view=rev
Log:
handle website updates and bumping HEAD


Added:
    apr/site/trunk/release/r4-stage-release.sh   (with props)
Modified:
    apr/site/trunk/release/common-lib.sh
    apr/site/trunk/release/env.sh
    apr/site/trunk/release/r0-make-candidate.sh

Modified: apr/site/trunk/release/common-lib.sh
URL: http://svn.apache.org/viewvc/apr/site/trunk/release/common-lib.sh?rev=1909174&r1=1909173&r2=1909174&view=diff
==============================================================================
--- apr/site/trunk/release/common-lib.sh (original)
+++ apr/site/trunk/release/common-lib.sh Sun Apr 16 14:31:23 2023
@@ -445,64 +445,40 @@ stage_checkout_release() {
   is_int ${v_patch} || fail "version patch '${v_patch}' is not a number"
   next_patch=`expr ${v_patch} + 1`
   NEXT_VERSION="${v_major}.${v_minor}.${next_patch}"
+  if [ $is_apr -eq 1 ]; then
+    PROJNAME=APR
+    PROJHEADER=apr_version.h
+  else
+    PROJNAME=APR-UTIL
+    PROJHEADER=apu_version.h
+  fi
 
   # Add the corresponding version placeholder in CHANGES.
-  perl -pi -e "s{(.*coding: utf-8.*)}{\$1\nChanges with Apache ${NEXT_VERSION}\n}" CHANGES
+  perl -pi -e "s{(.*coding: utf-8.*)}{\$1\nChanges for ${PROJNAME} ${NEXT_VERSION}\n}" CHANGES
   # Note the tag date in the STATUS file.
   if test -f STATUS; then
     date_string=`date '+%B %d, %Y'`
-    perl -pi -e '
-      if(/^(\s+)('${VERSION}'\s+):/){
-        $size = length $2;
-        $newline1 = sprintf("${1}%-${size}s", "'${NEXT_VERSION}'") . ": In development\n";
-        $newline2 = sprintf("${1}%-${size}s", "'${VERSION}'") . ": Released on '"${date_string}"'\n";
-        $_="${newline1}${newline2}";
-      }
-      ' STATUS
+    perl -pi -e "s/${VERSION}     : in maintenance/${NEXT_VERSION}     : in maintenance\n    ${VERSION}     : released ${date_string}/" STATUS
   fi
 
   # set the patch number of the next version
-  if test -f include/ap_release.h; then
-    echo "setting patch number in include/ap_release.h"
-    perl -pi -e 's/(#define\s+AP_SERVER_PATCHLEVEL_NUMBER\s+)\d*/${1}'${next_patch}'/g' include/ap_release.h
-    if ! grep -e "^#define *AP_SERVER_PATCHLEVEL_NUMBER *${next_patch}\$" include/ap_release.h >/dev/null 2>&1;then
-      fail "setting of AP_SERVER_PATCHLEVEL_NUMBER did not return expected value of ${next_patch}"
+  if test -f include/$PROJHEADER; then
+    echo "setting patch number in $PROJHEADER"
+    perl -pi -e 's/(#define\s+AP[RU]_PATCH_VERSION\s+)\d*/${1}'${next_patch}'/g' include/${PROJHEADER}
+    if ! grep -e "^#define *AP[RU]_PATCH_VERSION.*${next_patch}\$" include/${PROJHEADER} >/dev/null 2>&1;then
+      fail "setting of PATCH_VERSION did not return expected value of ${next_patch}"
     fi
   fi
 
   # Ensure the Copyright date reflects the current year
   current_year=`date +%Y`
-  for src in NOTICE docs/manual/style/xsl/common.xsl; do
+
+  # Ensure the Copyright date reflects the current year
+  for src in NOTICE include/apr_version.h; do
     if test -f "$src"; then
-      perl -pi -e "s/Copyright \d+ The Apache Software Foundation./Copyright $current_year The Apache Software Foundation./g" "$src"
+      perl -pi -e "s/\d+ The Apache Software/$current_year The Apache Software/g" "$src"
     fi
   done
-
-  if test -d docs/manual; then
-    if test -f docs/manual/style/version.ent; then
-      # Set ENTITY httpd.patch in docs/manual/style/version.ent.
-      echo "setting patch version in docs/manual/style/version.ent"
-      perl -pi -e 's/(.*ENTITY httpd.patch ")(\d+)(.*)/${1}'${next_patch}'${3}/g' docs/manual/style/version.ent
-      if ! grep -e "ENTITY *httpd.patch *\"${next_patch}\"" docs/manual/style/version.ent >/dev/null 2>&1;then
-        fail "setting of ENTITY httpd.patch did not return expected value of ${next_patch}"
-      fi
-    fi
-
-    echo "rebuilding manuals"
-    pushd docs/manual >/dev/null
-    #See http://httpd.apache.org/docs-project/docsformat.html for these instructions
-    if test -d build; then
-      svn update build
-    else
-      svn checkout "${SVN_DOCS_BUILD_URL}/trunk" build
-    fi
-    pushd build >/dev/null
-    ./build.sh all convmap
-    ./build.sh validate-xml
-    ./build.sh validate-xhtml
-    popd >/dev/null
-    popd >/dev/null
-  fi
 }
 
 checkout_pmc() {

Modified: apr/site/trunk/release/env.sh
URL: http://svn.apache.org/viewvc/apr/site/trunk/release/env.sh?rev=1909174&r1=1909173&r2=1909174&view=diff
==============================================================================
--- apr/site/trunk/release/env.sh (original)
+++ apr/site/trunk/release/env.sh Sun Apr 16 14:31:23 2023
@@ -2,4 +2,4 @@ DIST_DIR="dist"
 SVN_DIST_URL="https://dist.apache.org/repos/dist/"
 SVN_PMC_URL="https://svn.apache.org/repos/private/pmc"
 SVN_DOCS_BUILD_URL="https://svn.apache.org/repos/asf/httpd/docs-build"
-GIT_SITE_URL="git@github.com:apache/httpd-site.git"
+SVN_SITE_URL="https://svn.apache.org/repos/asf/apr/site/trunk"

Modified: apr/site/trunk/release/r0-make-candidate.sh
URL: http://svn.apache.org/viewvc/apr/site/trunk/release/r0-make-candidate.sh?rev=1909174&r1=1909173&r2=1909174&view=diff
==============================================================================
--- apr/site/trunk/release/r0-make-candidate.sh (original)
+++ apr/site/trunk/release/r0-make-candidate.sh Sun Apr 16 14:31:23 2023
@@ -121,7 +121,7 @@ fi
 
 
 # Ensure the Copyright date reflects the current year
-for src in NOTICE include/apr_version.h; do
+for src in NOTICE include/ap*_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"

Added: apr/site/trunk/release/r4-stage-release.sh
URL: http://svn.apache.org/viewvc/apr/site/trunk/release/r4-stage-release.sh?rev=1909174&view=auto
==============================================================================
--- apr/site/trunk/release/r4-stage-release.sh (added)
+++ apr/site/trunk/release/r4-stage-release.sh Sun Apr 16 14:31:23 2023
@@ -0,0 +1,130 @@
+#!/bin/sh
+
+# Publish a staged release to the world (website)
+#
+# USAGE: r4-stage-release.sh [version]
+# version: x.y.z (example 2.4.38)
+
+#Useful for debugging
+#set -x
+
+#Bail when non-zero return codes are encountered
+set -e
+
+usage () {
+    cat <<EOF 1>&2
+usage: $0 [options] [version]
+  prepare website and local checkouts for changes including removal of previous release
+  Does not commit anything, just prepares.
+  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
+    -n             dry run, do not exit on failures
+    -y             never ask, always assume yes
+EOF
+  exit 1
+}
+
+fail_not_dry() {
+  if test -z "${DRY_RUN}"; then
+    fail "$@"
+  fi
+  echo "IGNORED ERROR: $@"
+}
+
+fake_changes() {
+  changes="$1"
+  cat <<EOF > "${changes}"
+                                                         -*- coding: utf-8 -*-
+Changes with Apache ${VERSION}
+
+EOF
+}
+
+DRY_RUN=""
+while getopts "hny" opt; do
+    case $opt in
+        h)  usage
+            ;;
+        n)  DRY_RUN="1"
+            ;;
+        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_RELEASE="tags/${VERSION}"
+
+svn ls "$SVN_BASE/$SVN_RELEASE" >/dev/null 2>&1 ||
+  fail_not_dry "release does not exist in SVN: $SVN_RELEASE"
+
+AO_DIST_PATH="dist/apache.org-dist"
+AO_DIST_RELEASE_PATH="${AO_DIST_PATH}/release/${PROJECT}"
+
+DIST_SITEPATH="${DIST_DIR}/site"
+
+TAR_BASENAME="${PROJECT}-${VERSION}"
+
+# we should only keep on release in our dist repository,
+# remove the previous one if it exists
+prev_patch=`expr ${v_patch} - 1`
+PREV_VERSION="${v_major}.${v_minor}.${prev_patch}"
+for i in "${AO_DIST_DEV_PATH}/${PROJECT}-${PREV_VERSION}".tar.* \
+         "${AO_DIST_DEV_PATH}/CHANGES_${v_major}.${prev_patch}"; do
+  test -f "$i" && svn rm "$i"
+done
+
+
+########################################
+# checkout and patch the project website
+rm -rf "${DIST_SITEPATH}"
+svn co ${SVN_SITE_URL} "${DIST_SITEPATH}"
+
+if [ $is_apr -eq 1 ]; then
+    PROJNAME=APR
+    # followed immediately by version
+    HTML_REGEX="APR |apr-|Apache Portable Runtime "
+else
+    PROJNAME=APR-util
+    # followed immediately by version
+    HTML_REGEX="APR-util |apr-util-|Apache Portable Runtime Utility "
+fi
+#Update the site content with the new release date and version
+# XXX: doap.rdf has to be done manually for now
+echo "updating site content for ${PROJECT}-${VERSION}"
+
+date_string=`date '+%B %d, %Y'`
+#Modify the home page by replacing the date and the version string
+perl -pi -e "s/($HTML_REGEX)${v_major}\.${v_minor}\.\d+/\${1}${VERSION}/g" "${DIST_SITEPATH}/xdocs/download.xml" "${DIST_SITEPATH}/xdocs/index.xml"
+perl -pi -e "s/${VERSION}, released [^<]+/${VERSION}, released ${date_string}/" "${DIST_SITEPATH}/xdocs/index.xml"
+
+echo "adding site changes"
+stage_checkout_release
+
+echo
+echo "PENDING REPOSITORY CHANGES"
+echo "--------"
+echo "SVN changes staged for ${SVN_DIST_URL}"
+svn stat "${AO_DIST_RELEASE_PATH}"
+echo "--------"
+echo "SVN changes staged in pmc/${PROJECT}"
+svn stat "${DIST_DIR}/pmc"
+echo "--------"
+echo "svn changes staged in ${DIST_SITEPATH}"
+(cd "${DIST_SITEPATH}" && svn stat)
+echo "--------"
+echo "SVN changes staged in local checkout for ${SVN_URL}"
+svn stat
+
+save_version

Propchange: apr/site/trunk/release/r4-stage-release.sh
------------------------------------------------------------------------------
    svn:executable = *