Debian Codegraph @

source/tbird/dorelease

raw
1 #!/bin/sh -e
2 #
3 # We currently assume this script is run from the source directory
4 # (otherwise set a different value for SOURCE_DIR); the
5 # dummy_export script also makes certain assumption
6
7 set -o errexit
8
9 if [ -z $1 ]; then
10 echo "usage: $0 <CVS username>"
11 exit
12 fi
13
14 CVS_USERNAME=$1
15 CVSROOT=":pserver:${CVS_USERNAME}@www.mozdev.org:/cvs"
16 SOURCE_DIR=`pwd`
17 DOWNLOADS_DIR="$SOURCE_DIR/../../downloads"
18 BUILDTOOLS_DIR="$SOURCE_DIR/../buildtools"
19
20 # determine version number
21 VERSION=`grep VERSION=\" dobuild | cut -d\" -f2 | head -1`
22 SHORTNAME=`grep SHORTNAME=\" dobuild | cut -d\" -f2`
23 USCORED_VERSION=`echo $VERSION | tr . _`
24 CAPS_SHORTNAME=`echo ${SHORTNAME} | tr a-z A-Z`
25 RELEASE_TAG="${CAPS_SHORTNAME}_RELEASE_${USCORED_VERSION}"
26 # this causes the dobuild script not to build a beta version
27 export EXTENSION_RELEASE=1
28
29 # create new version directory
30
31 if [ ! -d "${DOWNLOADS_DIR}/${VERSION}" ]; then
32 mkdir "${DOWNLOADS_DIR}/${VERSION}"
33 fi
34
35 # build the release versions and place them in the appropriate directories
36
37 (./dobuild suitelegacy && ./dobuild suiterunner && ./dobuild tbird) || exit
38
39 for target in tbird suiterunner suitelegacy; do
40 cp build/${target}/${SHORTNAME}_${VERSION}_${target}.xpi ${DOWNLOADS_DIR}/${VERSION}/${SHORTNAME}_${target}.xpi
41 cp build/${target}/${SHORTNAME}_${VERSION}_${target}.xpi ${DOWNLOADS_DIR}/latest/${SHORTNAME}_${target}.xpi
42 done
43
44
45 # create a CVS tag for the code used to build the release
46
47 cd ${SOURCE_DIR}
48 until cvs -d $CVSROOT tag -d ${RELEASE_TAG}; do : ; done
49 until cvs -d $CVSROOT tag ${RELEASE_TAG}; do : ; done
50
51 cd ${BUILDTOOLS_DIR}
52 until cvs -d $CVSROOT tag -d ${RELEASE_TAG}; do : ; done
53 until cvs -d $CVSROOT tag ${RELEASE_TAG}; do : ; done
54
55 cd ${SOURCE_DIR}
56 # Workaround for a mozdev cvs tagging bug, see
57 # https://www.mozdev.org/bugs/show_bug.cgi?id=14797
58 # and
59 # http://www.mozdev.org/drupal/wiki/MozdevCVSTipsTroubleshooting
60 # for details
61 until ${SOURCE_DIR}/dummy_export ${CVS_USERNAME}; do : ; done
62
63 # add the release to the CVS repository
64 # (it gets propagated to the mozdev download mirrors)
65
66 cd ${DOWNLOADS_DIR}
67
68 if [ ! -e ${VERSION}/CVS ]; then
69 until cvs -d $CVSROOT add ${VERSION}/; do : ; done
70 fi
71 XPI_ENTIRES_IN_VERSION_DIR=`grep xpi ${VERSION}/CVS/Entries | wc -l`
72 if [ ${XPI_ENTIRES_IN_VERSION_DIR} == 0 ]; then
73 until cvs -d $CVSROOT add `ls ${VERSION}/*.xpi`; do : ; done
74 fi
75 until cvs -d $CVSROOT ci ${VERSION}/ latest/; do : ; done