You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by aa...@apache.org on 2003/11/17 00:03:05 UTC

cvs commit: httpd-dist/tools release.sh

aaron       2003/11/16 15:03:05

  Modified:    tools    release.sh
  Log:
  've updated the tools/release.sh script in the httpd-dist CVS
  repository to make it easier for anyone to create HTTPD tarballs.
  Before it was necessary for a tag to exist before a tarball could
  be created. This made it very difficult to release
  experimental/developmental tarballs to a set of users for testing,
  since we only like to make tags for releases that we believe will
  be voted GA.
  
  The new script takes away the VERSION parameter and replaces it
  with two new parameters:
    TAG is the CVS tag that we will pull from.
    RELEASE-VERSION is the name that we'll give the tarball.
  
  Revision  Changes    Path
  1.7       +26 -56    httpd-dist/tools/release.sh
  
  Index: release.sh
  ===================================================================
  RCS file: /home/cvs/httpd-dist/tools/release.sh,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- release.sh	9 Jul 2003 11:11:12 -0000	1.6
  +++ release.sh	16 Nov 2003 23:03:05 -0000	1.7
  @@ -2,7 +2,7 @@
   #
   # release.sh : build a release tarball
   #
  -# USAGE: release.sh [--security TAG] PROJECT VERSION [SIGNING-USER]
  +# USAGE: release.sh [--security TAG] PROJECT TAG RELEASE_VERSION [SIGNING-USER]
   #
   #   The project is either 'httpd-2.0' or 'httpd-2.1'
   #
  @@ -23,59 +23,39 @@
   ${RELEASECHECK} || exit 1
   
   if test "$1" == "--security"; then
  -  tag="$2"
  +  securitytag="$2"
     security_release=1
     shift 2
   fi
   
  -if test "$#" != 2 && test "$#" != 3; then
  -  echo "USAGE: $0 [--security TAG] PROJECT VERSION [SIGNING-USER]" >&2
  +if test "$#" != 3 && test "$#" != 4; then
  +  echo "USAGE: $0 [--security TAG] PROJECT TAG RELEASE-VERSION [SIGNING-USER]" >&2
     echo "  see the comments in this script for more info." >&2
     exit 1
   fi
   
  -case "$1" in
  -  httpd-2.0)
  -    repos_name="httpd-2.0"
  -    tag_prefix="APACHE"
  -    ver_path="include/ap_release.h"
  -    ver_define="AP_SERVER_PATCHLEVEL"
  +PROJECT=$1
  +TAG=$2
  +RELEASE_VERSION=$3
  +SIGNING_USER=$4
   
  -    expected_major="2"
  -    expected_minor="0"
  -    
  -    apr_xxx_in_srclib=1
  -    ;;
  -  httpd-2.1)
  +case "$PROJECT" in
  +  httpd|httpd-2.0|httpd-2.1)
       repos_name="httpd-2.0"
       tag_prefix="APACHE"
       ver_path="include/ap_release.h"
       ver_define="AP_SERVER_PATCHLEVEL"
   
  -    expected_major="2"
  -    expected_minor="1"
  -
       apr_xxx_in_srclib=1
       ;;
     *)
  -    echo "ERROR: '$1' is an unknown project." >&2
  -    echo "  choose one of: httpd-2.0, httpd-2.1" >&2
  +    echo "ERROR: '$PROJECT' is an unknown project." >&2
  +    echo "  choose one of: httpd, httpd-2.0, httpd-2.1" >&2
       exit 1
   esac
   
  -vsn="$2"
  -major="`echo $vsn | sed 's/\..*$//'`"
  -minor="`echo $vsn | sed 's/^[0-9]*\.\([0-9]*\)\..*$/\1/'`"
  -patch="`echo $vsn | sed 's/^.*\.//'`"
  -
  -if test "${tag}" != ""; then
  -  tagname="${tag}"
  -else
  -  tagname="${tag_prefix}_${major}_${minor}_${patch}"
  -fi
  -
   dirname="`echo $repos_name | sed 's/-[0-9]*\.[0-9]*$//'`"
  -dirname="${dirname}-$vsn"
  +dirname="${dirname}-${RELEASE_VERSION}"
   
   split="---------------------------------------------------------------------"
   
  @@ -85,16 +65,11 @@
   if test ${security_release}; then
     echo "  SECURITY RELEASE"
   fi
  -echo "  Version: $vsn"
  -echo " Tag name: $tagname"
  -echo "Directory: $dirname"
  +echo "       Tag name: $TAG"
  +echo "Release Version: $RELEASE_VERSION"
  +echo "      Directory: $dirname"
   echo ""
   
  -if test "${expected_major}" -ne "${major}" || test "${expected_minor}" -ne "${minor}"; then
  -  echo "ERROR: project doesn't match tag" >&2
  -  exit 1
  -fi
  -
   if test -d ${dirname}; then
     echo "ERROR: for safety, you must manually remove $dirname." >&2
     exit 1
  @@ -109,14 +84,14 @@
   echo "Starting CVS export of ${repos_name} to $dirname ..."
   echo ""
   
  -cvs -d cvs.apache.org:/home/cvs export -r ${tagname} -d ${dirname} ${repos_name} > /dev/null || exit 1
  +cvs -d cvs.apache.org:/home/cvs export -r ${TAG} -d ${dirname} ${repos_name} > /dev/null || exit 1
   
  -### Add a check to see if what was checked out matches $vsn
  +### Add a check to see if what was checked out matches $TAG
   
   if test $apr_xxx_in_srclib; then
     ( cd ${dirname}/srclib &&
  -    cvs -d cvs.apache.org:/home/cvs export -r ${tagname} apr >/dev/null &&
  -    cvs -d cvs.apache.org:/home/cvs export -r ${tagname} apr-util >/dev/null
  +    cvs -d cvs.apache.org:/home/cvs export -r ${TAG} apr >/dev/null &&
  +    cvs -d cvs.apache.org:/home/cvs export -r ${TAG} apr-util >/dev/null
     ) || exit 1
   fi
   
  @@ -130,9 +105,9 @@
     rm ${dirname}/${ver_path}~
     echo ""
   
  -  echo "Starting CVS checkout of httpd-security/patches/${vsn}-dev to ${dirname}-patches"
  +  echo "Starting CVS checkout of httpd-security/patches/${RELEASE_VERSION}-dev to ${dirname}-patches"
     echo ""
  -  cvs -d cvs.apache.org:/home/cvs co -d ${dirname}-patches httpd-security/patches/${vsn}-dev > /dev/null || exit 1
  +  cvs -d cvs.apache.org:/home/cvs co -d ${dirname}-patches httpd-security/patches/${RELEASE_VERSION}-dev > /dev/null || exit 1
     echo ""
     
     echo "Applying patches..."
  @@ -145,11 +120,6 @@
     
     echo $split
     echo ""
  -
  -elif grep "#define.*${ver_define}.*-dev" ${dirname}/${ver_path} > /dev/null; then
  -  echo "ERROR: ${ver_path} still defines a development version." >&2
  -  echo "       This script can only produce formal releases." >&2
  -  exit 1
   fi
   
   echo "Copying CHANGES file"
  @@ -200,15 +170,15 @@
   fi
   
   if test -x "`which pgp 2> /dev/null`"; then
  -  if test -n "$3"; then
  -    user="-u $3"
  +  if test -n "$SIGNING_USER"; then
  +    user="-u $SIGNING_USER"
     fi
   
     pgp -sba ${dirname}.tar.gz ${user}
     pgp -sba ${dirname}.tar.Z ${user}
   elif test -x "`which gpg 2> /dev/null`"; then
  -  if test -n "$3"; then
  -    user="--default-key $3"
  +  if test -n "$SIGNING_USER"; then
  +    user="--default-key $SIGNING_USER"
     fi
   
     gpg --armor ${user} --detach-sign ${dirname}.tar.gz