Return-Path: Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: (qmail 94943 invoked from network); 19 Mar 2004 16:04:08 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 19 Mar 2004 16:04:08 -0000 Received: (qmail 40529 invoked by uid 500); 19 Mar 2004 16:03:38 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 40504 invoked by uid 500); 19 Mar 2004 16:03:37 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 40472 invoked by uid 500); 19 Mar 2004 16:03:37 -0000 Delivered-To: apmail-httpd-dist-cvs@apache.org Received: (qmail 40457 invoked from network); 19 Mar 2004 16:03:37 -0000 Received: from unknown (HELO minotaur.apache.org) (209.237.227.194) by daedalus.apache.org with SMTP; 19 Mar 2004 16:03:37 -0000 Received: (qmail 94741 invoked by uid 1343); 19 Mar 2004 16:03:42 -0000 Date: 19 Mar 2004 16:03:42 -0000 Message-ID: <20040319160342.94740.qmail@minotaur.apache.org> From: striker@apache.org To: httpd-dist-cvs@apache.org Subject: cvs commit: httpd-dist/tools roll.sh release.sh X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N striker 2004/03/19 08:03:42 Modified: tools release.sh Added: tools roll.sh Log: Update the release script to what was used for the last release cycle. Revision Changes Path 1.9 +124 -101 httpd-dist/tools/release.sh Index: release.sh =================================================================== RCS file: /home/cvs/httpd-dist/tools/release.sh,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- release.sh 16 Nov 2003 23:14:30 -0000 1.8 +++ release.sh 19 Mar 2004 16:03:42 -0000 1.9 @@ -2,7 +2,7 @@ # # release.sh : build a release tarball # -# USAGE: release.sh [--security TAG] PROJECT TAG RELEASE_VERSION [SIGNING-USER] +# USAGE: release.sh [--security] [--tag TAG POSTFIX] PROJECT VERSION [SIGNING-USER] # # The project is either 'httpd-2.0' or 'httpd-2.1' # @@ -17,45 +17,99 @@ # release with. # -# Run tests to ensure that our requirements are met - RELEASECHECK="`echo $0 | sed 's/release.sh$/releasecheck.sh/'`" -${RELEASECHECK} || exit 1 +ROLL="`echo $0 | sed 's/release.sh$/roll.sh/'`" -if test "$1" == "--security"; then - securitytag="$2" - security_release=1 - shift 2 -fi +while true +do + case "$1" in + --security) + security_release=1 + shift + ;; + + --tag) + tagged_release=1 + tag="$2" + postfix="$3" + shift 3 + ;; + + --*) + echo "Unknown option '$1'" >&2 + echo "USAGE: $0 [--security] [--tag TAG POSTFIX] PROJECT VERSION [SIGNING-USER]" >&2 + echo " see the comments in this script for more info." >&2 + exit 1 + ;; + + *) + # apparently there are no options left + break + ;; + esac +done -if test "$#" != 3 && test "$#" != 4; then - echo "USAGE: $0 [--security TAG] PROJECT TAG RELEASE-VERSION [SIGNING-USER]" >&2 +if test "$#" != 2 && test "$#" != 3; then + echo "USAGE: $0 [--security] [--tag TAG POSTFIX] PROJECT VERSION [SIGNING-USER]" >&2 echo " see the comments in this script for more info." >&2 exit 1 fi -PROJECT=$1 -TAG=$2 -RELEASE_VERSION=$3 -SIGNING_USER=$4 +# Run tests to ensure that our requirements are met +${RELEASECHECK} || exit 1 + +project="$1" +version="$2" +user="$3" + +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" -case "$PROJECT" in - httpd|httpd-2.0|httpd-2.1) + expected_major="2" + expected_minor="0" + + apr_xxx_in_srclib=1 + ;; + 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: '$PROJECT' is an unknown project." >&2 - echo " choose one of: httpd, httpd-2.0, httpd-2.1" >&2 + echo "ERROR: '$1' is an unknown project." >&2 + echo " choose one of: httpd-2.0, httpd-2.1" >&2 exit 1 esac -dirname="`echo $repos_name | sed 's/-[0-9]*\.[0-9]*$//'`" -dirname="${dirname}-${RELEASE_VERSION}" +major="`echo ${version} | sed 's/\..*$//'`" +minor="`echo ${version} | sed 's/^[0-9]*\.\([0-9]*\)\..*$/\1/'`" +patch="`echo ${version} | sed 's/^.*\.//'`" + +if test ${tagged_release}; then + tagname="${tag}" +else + tagname="${tag_prefix}_${major}_${minor}_${patch}" +fi + +dirname="`echo ${repos_name} | sed 's/-[0-9]*\.[0-9]*$//'`" +dirname="${dirname}-${version}" +if test "${postfix}" != ""; then + postfix="-${postfix}" + dirname="${dirname}${postfix}" +fi +if test ${security_release}; then + dirname="${dirname}-security" +fi split="---------------------------------------------------------------------" @@ -65,13 +119,18 @@ if test ${security_release}; then echo " SECURITY RELEASE" fi -echo " Tag name: $TAG" -echo "Release Version: $RELEASE_VERSION" -echo " Directory: $dirname" +echo " Version: ${version}" +echo " Tag name: ${tagname}" +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 + echo "ERROR: for safety, you must manually remove ${dirname}." >&2 exit 1 fi @@ -81,40 +140,61 @@ echo $split echo "" -echo "Starting CVS export of ${repos_name} to $dirname ..." +echo "Starting CVS export of ${repos_name} to ${dirname} ..." echo "" -cvs -d cvs.apache.org:/home/cvs export -r ${TAG} -d ${dirname} ${repos_name} > /dev/null || exit 1 +cvs -d cvs.apache.org:/home/cvs export -r ${tagname} -d ${dirname} ${repos_name} > /dev/null || exit 1 -### Add a check to see if what was checked out matches $TAG +### Add a check to see if what was checked out matches $vsn -if test $apr_xxx_in_srclib; then +if test ${apr_xxx_in_srclib}; then ( cd ${dirname}/srclib && - 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 + 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 ) || exit 1 fi echo $split echo "" -if test $security_release; then - echo "Fixing up version define (stripping -dev)" - mv ${dirname}/${ver_path} ${dirname}/${ver_path}~ - cat ${dirname}/${ver_path}~ | sed -e "s/\(${ver_define}.*\)-dev/\1/" > ${dirname}/${ver_path} - rm ${dirname}/${ver_path}~ +if test ${tagged_release}; then +# echo "Fixing up version define (replacing -dev with ${postfix})" +# mv ${dirname}/${ver_path} ${dirname}/${ver_path}~ +# cat ${dirname}/${ver_path}~ | sed -e "s/\(${ver_define}.*\)-dev/\1${postfix}/" > ${dirname}/${ver_path} +# rm ${dirname}/${ver_path}~ echo "" - 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/${RELEASE_VERSION}-dev > /dev/null || exit 1 + 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 + +if test ${security_release}; then + patch_dir="${dirname}-patches" + + if test -d "${patch_dir}"; then + echo "Starting CVS update of ${patch_dir}" + echo "" + ( cd ${patch_dir} && + cvs up -dP 2>/dev/null + ) || exit 1 + echo "" + else + echo "Starting CVS checkout of httpd-security/patches/${version}-dev to ${patch_dir}" + echo "" + cvs -d cvs.apache.org:/home/cvs co -d ${patch_dir} httpd-security/patches/${version}-dev > /dev/null || exit 1 + echo "" + fi echo "Applying patches..." - for p in `find ${dirname}-patches -type f -name '*.patch'` + for p in `find ${patch_dir} -type f -name '*.patch'` do - ( cd $dirname && - cat ../$p | patch -p0 --no-backup-if-mismatch + ( cd ${dirname} && + cat ../${p} | patch -p0 --no-backup-if-mismatch ) || exit 1 done @@ -125,64 +205,7 @@ echo "Copying CHANGES file" echo "" -cp $dirname/CHANGES CHANGES_${dirname} - -echo $split -echo "" -echo "Eliminating unwanted files (e.g. .cvsignore) and generating initial" -echo "files via buildconf ..." -echo "" - -find $dirname -name .cvsignore | xargs rm -f -find $dirname -name autom4te*.cache | xargs rm -rf -find $dirname -name STATUS | xargs rm -rf - -(cd ${dirname} && ./buildconf) || exit 1 +cp ${dirname}/CHANGES CHANGES_${major}.${minor} -find $dirname -name autom4te*.cache | xargs rm -rf - -echo "" -echo "Fixup the timestamps preventing remake of generated files." -touch $dirname/modules/ssl/ssl_expr_parse.c -touch $dirname/modules/ssl/ssl_expr_parse.h -touch $dirname/modules/ssl/ssl_expr_scan.c -echo "" +${ROLL} ${dirname} ${user} || exit 1 -echo $split -echo "" -echo "Building the tarball, .gz, and .Z files ..." -echo "" - -tar cf ${dirname}.tar ${dirname} -gzip -9 --to-stdout ${dirname}.tar > ${dirname}.tar.gz -compress ${dirname}.tar - -echo $split -echo "" -echo "Cleaning up and signing the files ..." -echo "" - -rm -rf ${dirname} - -if test -x "`which md5sum 2> /dev/null`"; then - md5sum ${dirname}.tar.gz > ${dirname}.tar.gz.md5 - md5sum ${dirname}.tar.Z > ${dirname}.tar.Z.md5 -fi - -if test -x "`which pgp 2> /dev/null`"; then - 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 "$SIGNING_USER"; then - user="--default-key $SIGNING_USER" - fi - - gpg --armor ${user} --detach-sign ${dirname}.tar.gz - gpg --armor ${user} --detach-sign ${dirname}.tar.Z -else - echo "PGP or GnuPG not found! Not signing release!" -fi 1.1 httpd-dist/tools/roll.sh Index: roll.sh =================================================================== #!/bin/sh # # roll.sh : build a release tarball # # USAGE: roll.sh SOURCE [SIGNING-USER] # # The "signing user" is the name of the key that you'll be signing the # release with. # # Run tests to ensure that our requirements are met RELEASECHECK="`echo $0 | sed 's/roll.sh$/releasecheck.sh/'`" ${RELEASECHECK} || exit 1 dirname="$1" user="$2" if test "$#" != 1 && test "$#" != 2; then echo "USAGE: $0 SOURCE [SIGNING-USER]" >&2 echo " see the comments in this script for more info." >&2 exit 1 fi split="---------------------------------------------------------------------" echo $split echo "" # make sure that the perms are good for the tarball umask 022 echo "Eliminating unwanted files (e.g. .cvsignore) and generating initial" echo "files via buildconf ..." echo "" find $dirname -name .cvsignore | xargs rm -f find $dirname -name autom4te*.cache | xargs rm -rf find $dirname -name STATUS | xargs rm -rf (cd ${dirname} && ./buildconf) || exit 1 find $dirname -name autom4te*.cache | xargs rm -rf echo "" echo "Fixup the timestamps preventing remake of generated files." touch $dirname/modules/ssl/ssl_expr_parse.c touch $dirname/modules/ssl/ssl_expr_parse.h touch $dirname/modules/ssl/ssl_expr_scan.c echo "" echo $split echo "" echo "Building the tarball, .gz, and .Z files ..." echo "" tar cf ${dirname}.tar ${dirname} gzip -9 --to-stdout ${dirname}.tar > ${dirname}.tar.gz compress ${dirname}.tar echo $split echo "" echo "Cleaning up and signing the files ..." echo "" md5sum="`which md5sum md5 2> /dev/null | head -1`" if test -x "${md5sum}"; then ${md5sum} ${dirname}.tar.gz > ${dirname}.tar.gz.md5 ${md5sum} ${dirname}.tar.Z > ${dirname}.tar.Z.md5 fi if test -x "`which pgp 2> /dev/null`"; then if test -n "${user}"; then args="-u ${user}" fi pgp -sba ${dirname}.tar.gz ${args} pgp -sba ${dirname}.tar.Z ${args} elif test -x "`which gpg 2> /dev/null`"; then if test -n "${user}"; then args="--default-key ${args}" fi gpg --armor ${args} --detach-sign ${dirname}.tar.gz gpg --armor ${args} --detach-sign ${dirname}.tar.Z else echo "PGP or GnuPG not found! Not signing release!" fi