3 # Copyright (c) 2005 The SCons Foundation
5 # Permission is hereby granted, free of charge, to any person obtaining
6 # a copy of this software and associated documentation files (the
7 # "Software"), to deal in the Software without restriction, including
8 # without limitation the rights to use, copy, modify, merge, publish,
9 # distribute, sublicense, and/or sell copies of the Software, and to
10 # permit persons to whom the Software is furnished to do so, subject to
11 # the following conditions:
13 # The above copyright notice and this permission notice shall be included
14 # in all copies or substantial portions of the Software.
16 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
17 # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
18 # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20 # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 NOARGFLAGS="afhlnqrstz"
27 ALLFLAGS="${NOARGFLAGS}${ARGFLAGS}"
28 USAGE="Usage: ${PROG} [-${NOARGFLAGS}] [-p project] change"
32 -a Update the latest Aegis baseline (aedist) file.
33 -f Force update, skipping up-front sanity check.
34 -h Print this help message and exit.
35 -l Update the local CVS repository.
36 -n Don't execute, just echo commands.
37 -p project Set the Aegis project.
38 -q Quiet, don't print commands before executing them.
39 -r Rsync the Aegis repository to SourceForge.
40 -s Update the sourceforge.net CVS repository.
41 -t Update the tigris.org CVS repository.
42 -z Update the latest .tar.gz and .zip files.
50 while getopts $ALLFLAGS FLAG; do
52 a | l | r | s | t | z )
66 AEGIS_PROJECT="${OPTARG}"
72 echo "FLAG = ${FLAG}" >&2
79 shift `expr ${OPTIND} - 1`
81 if test "X$1" = "X"; then
86 if test "X${AEGIS_PROJECT}" = "X"; then
87 echo "$PROG: No AEGIS_PROJECT set." >&2
92 if test "X$DO" = "X"; then
104 if test "X${SANITY_CHECK}" = "Xyes"; then
106 SCMROOT="/home/scons/CVSROOT/scons"
107 DELTA=`aegis -l -ter cd ${CHANGE} | sed -n 's/.*, Delta \([0-9]*\)\./\1/p'`
108 if test "x${DELTA}" = "x"; then
109 echo "${PROG}: Could not find delta for change ${CHANGE}." >&2
110 echo "Has this finished integrating? Change ${CHANGE} not distributed." >&2
113 PREV_DELTA=`expr ${DELTA} - 1`
114 COMMAND="scons-scmcheck -D ${PREV_DELTA} -d q -p ${AEGIS_PROJECT} -s ${SCM} ${SCMROOT}"
117 if test "X${OUTPUT}" != "X"; then
118 echo "${PROG}: ${SCMROOT} is not up to date:" >&2
119 echo "${OUTPUT}" >& 2
120 echo "Did you skip any changes? Change ${CHANGE} not distributed." >&2
125 if test X$EXECUTE != "X:" -a "X$SSH_AGENT_PID" = "X"; then
128 trap 'eval `ssh-agent -k`; exit' 0 1 2 3 15
133 BASELINE=`aesub -p ${AEGIS_PROJECT} -c ${CHANGE} '${Project trunk_name}'`
135 TMPBLAE="/tmp/${BASELINE}.ae"
136 TMPCAE="/tmp/${AEGIS_PROJECT}.C${CHANGE}.ae"
138 # Original values for SourceForge.
139 #SFLOGIN="stevenknight"
140 #SFHOST="scons.sourceforge.net"
141 #SFDEST="/home/groups/s/sc/scons/htdocs"
144 SCONSHOST="manam.pair.com"
145 #SCONSDEST="public_html/production"
146 SCONSDEST="public_ftp"
149 # Copy the baseline .ae to the constant location on SourceForge.
153 cmd "aedist -s -bl -p ${AEGIS_PROJECT} > ${TMPBLAE}"
154 cmd "scp ${TMPBLAE} ${SCONSLOGIN}@${SCONSHOST}:${SCONSDEST}/${BASELINE}.ae"
160 # Copy the latest .tar.gz and .zip files to the constant location on
165 BUILD_DIST=`aegis -p ${AEGIS_PROJECT} -cd -bl`/build/dist
166 SCONS_SRC_TAR_GZ=`echo ${AEGIS_PROJECT} | sed 's/scons./scons-src-/'`*.tar.gz
167 SCONS_SRC_ZIP=`echo ${AEGIS_PROJECT} | sed 's/scons./scons-src-/'`*.zip
168 cmd "scp ${BUILD_DIST}/${SCONS_SRC_TAR_GZ} ${SCONSLOGIN}@${SCONSHOST}:${SCONSDEST}/scons-src-latest.tar.gz"
169 cmd "scp ${BUILD_DIST}/${SCONS_SRC_ZIP} ${SCONSLOGIN}@${SCONSHOST}:${SCONSDEST}/scons-src-latest.zip"
173 # Sync Aegis tree with SourceForge.
175 # Cribbed and modified from Peter Miller's same-named script in
176 # /home/groups/a/ae/aegis/aegis at SourceForge.
178 # Guide to what this does with rsync:
180 # --rsh=ssh use ssh for the transfer
181 # -l copy symlinks as symlinks
182 # -p preserve permissions
186 # --stats file transfer statistics
187 # --exclude exclude files matching the pattern
188 # --delete delete files that don't exist locally
189 # --delete-excluded delete files that match the --exclude patterns
190 # --progress show progress during the transfer
193 # We no longer use the --stats option.
197 LOCAL=/home/scons/scons
198 REMOTE=/home/groups/s/sc/scons/scons
199 cmd "/usr/bin/rsync --rsh='ssh -l stevenknight' \
204 --exclude aegis.log \
205 --exclude '.sconsign*' \
206 --delete --delete-excluded \
208 ${LOCAL}/. scons.sourceforge.net:${REMOTE}/."
213 # Sync the CVS tree with the local repository.
218 export CVSROOT=/home/scons/CVSROOT/scons
219 #cmd "ae2cvs -X -aegis -p ${AEGIS_PROJECT} -c ${CHANGE} -u $HOME/SCons/baldmt.com/scons"
220 cmd "ae-cvs-ci ${AEGIS_PROJECT} ${CHANGE}"
226 # Sync the Subversion tree with Tigris.org.
231 SVN=http://scons.tigris.org/svn/scons
232 case ${AEGIS_PROJECT} in
234 SVN_URL=${SVN}/branches/core
237 SVN_URL=${SVN}/branches/sigrefactor
240 echo "$PROG: Don't know SVN branch for '${AEGIS_PROJECT}'" >&2
244 SVN_CO_FLAGS="--username stevenknight"
245 #cmd "ae2cvs -X -aegis -p ${AEGIS_PROJECT} -c ${CHANGE} -u $HOME/SCons/tigris.org/scons"
246 cmd "ae-svn-ci ${AEGIS_PROJECT} ${CHANGE} ${SVN_URL} ${SVN_CO_FLAGS}"
252 # Sync the CVS tree with SourceForge.
258 export CVSROOT=:ext:stevenknight@scons.cvs.sourceforge.net:/cvsroot/scons
259 #cmd "ae2cvs -X -aegis -p ${AEGIS_PROJECT} -c ${CHANGE} -u $HOME/SCons/sourceforge.net/scons"
260 cmd "ae-cvs-ci ${AEGIS_PROJECT} ${CHANGE}"
266 # Send the change .ae to the scons-aedist mailing list
268 # The subject requires editing by hand...
270 #aedist -s -p ${AEGIS_PROJECT} ${CHANGE} > ${TMPCAE}
271 #aegis -l -p ${AEGIS_PROJECT} -c ${CHANGE} cd |
272 # pine -attach_and_delete ${TMPCAE} scons-aedist@lists.sourceforge.net