apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jerenkra...@apache.org
Subject cvs commit: apr-dist/tools release.sh
Date Thu, 12 Sep 2002 00:40:24 GMT
jerenkrantz    2002/09/11 17:40:24

  Modified:    tools    release.sh
  Log:
  Tweak release.sh to allow apr-util to be used with this script.
  
  Use: ./release.sh apr 0.9.0 etc
  
  Revision  Changes    Path
  1.3       +42 -22    apr-dist/tools/release.sh
  
  Index: release.sh
  ===================================================================
  RCS file: /home/cvs/apr-dist/tools/release.sh,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -u -r1.2 -r1.3
  --- release.sh	28 Aug 2002 09:50:38 -0000	1.2
  +++ release.sh	12 Sep 2002 00:40:24 -0000	1.3
  @@ -2,7 +2,9 @@
   #
   # release.sh : build a release tarball
   #
  -# USAGE: release.sh VERSION [SIGNING-USER]
  +# USAGE: release.sh PROJECT VERSION [SIGNING-USER]
  +#
  +#   The project is either 'apr' or 'apr-util'
   #
   #   The version number is specified as MAJOR.MINOR.PATCH (and will be used
   #   in the output tarball name). The script will then look for a CVS tag
  @@ -15,20 +17,33 @@
   #   release with.
   #
   
  -if test "$#" != 1 && test "$#" != 2; then
  -  echo "USAGE: $0 VERSION [SIGNING-USER]"
  +if test "$#" != 2 && test "$#" != 3; then
  +  echo "USAGE: $0 PROJECT VERSION [SIGNING-USER]"
     echo "  see the comments in this script for more info."
     exit 1
   fi
   
  -vsn="$1"
  -major="`echo $1 | sed 's/\..*$//'`"
  -minor="`echo $1 | sed 's/^[0-9]*\.\([0-9]*\)\..*$/\1/'`"
  -patch="`echo $1 | sed 's/^.*\.//'`"
  +case "$1" in
  +  apr)
  +    repos_name="apr"
  +    tag_prefix="APR"
  +    ver_prefix="apr"
  +    ;;
  +  apr-util)
  +    repos_name="apr-util"
  +    tag_prefix="APU"
  +    ver_prefix="apu"
  +    ;;
  +esac
  +
  +vsn="$2"
  +major="`echo $2 | sed 's/\..*$//'`"
  +minor="`echo $2 | sed 's/^[0-9]*\.\([0-9]*\)\..*$/\1/'`"
  +patch="`echo $2 | sed 's/^.*\.//'`"
   
  -tagname="APR_${major}_${minor}_${patch}"
  +tagname="${tag_prefix}_${major}_${minor}_${patch}"
   
  -dirname="apr-$vsn"
  +dirname="${repos_name}-$vsn"
   
   echo "  Version: $vsn"
   echo " Tag name: $tagname"
  @@ -46,17 +61,17 @@
   
   echo $split
   echo ""
  -echo "Starting CVS export of APR to $dirname ..."
  +echo "Starting CVS export of ${repos_name} to $dirname ..."
   echo ""
   
  -cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic export -r ${tagname} -d ${dirname}
apr > /dev/null || exit 1
  +cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic export -r ${tagname} -d ${dirname}
${repos_name} > /dev/null || exit 1
   
   echo $split
   echo ""
   
  -if grep '#define.*APR_IS_DEV_VERSION' ${dirname}/include/apr_version.h > /dev/null;
then
  -  echo "ERROR: apr_version.h still defines a development version. This"
  -  echo "       script can only produce formal releases."
  +if grep "#define.*${tag_prefix}_IS_DEV_VERSION" ${dirname}/include/${ver_prefix}_version.h
> /dev/null; then
  +  echo "ERROR: ${ver_prefix}_version.h still defines a development version."
  +  echo "       This script can only produce formal releases."
     exit 1
   fi
   
  @@ -68,7 +83,7 @@
   find $dirname -name autom4te.cache | xargs rm -rf
   rm -f $dirnme/STATUS
   
  -(cd ${dirname} && ./buildconf) || exit 1
  +# (cd ${dirname} && ./buildconf) || exit 1
   
   echo $split
   echo ""
  @@ -86,18 +101,21 @@
   
   rm -rf ${dirname}
   
  -if which pgp > /dev/null 2>&1; then
  -  if test -n "$2"; then
  -    user="-u $2"
  +if test -x "`which pgp 2> /dev/null`"; then
  +  if test -n "$3"; then
  +    user="-u $3"
     fi
   
     pgp -sba ${dirname}.tar.gz ${user}
     pgp -sba ${dirname}.tar.Z ${user}
   
  -  ### md5 summaries?
  -else
  -  if test -n "$2"; then
  -    user="--default-key $2"
  +  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
  +elif test -x "`which gpg 2> /dev/null`"; then
  +  if test -n "$3"; then
  +    user="--default-key $3"
     fi
   
     gpg --armor ${user} --detach-sign ${dirname}.tar.gz
  @@ -105,4 +123,6 @@
   
     gpg --print-md md5 ${dirname}.tar.gz > ${dirname}.tar.gz.md5
     gpg --print-md md5 ${dirname}.tar.Z > ${dirname}.tar.Z.md5
  +else
  +  echo "PGP or GnuPG not found!  Not signing release!"
   fi
  
  
  

Mime
View raw message