2 # -*- Mode: Shell-script; tab-width: 4; indent-tabs-mode: nil; -*-
3 # ***** BEGIN LICENSE BLOCK *****
4 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
6 # The contents of this file are subject to the Mozilla Public License Version
7 # 1.1 (the "License"); you may not use this file except in compliance with
8 # the License. You may obtain a copy of the License at
9 # http://www.mozilla.org/MPL/
11 # Software distributed under the License is distributed on an "AS IS" basis,
12 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 # for the specific language governing rights and limitations under the
16 # The Original Code is mozilla.org code.
18 # The Initial Developer of the Original Code is
19 # Mozilla Corporation.
20 # Portions created by the Initial Developer are Copyright (C) 2006.
21 # the Initial Developer. All Rights Reserved.
24 # Bob Clary <bob@bclary.com>
26 # Alternatively, the contents of this file may be used under the terms of
27 # either the GNU General Public License Version 2 or later (the "GPL"), or
28 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29 # in which case the provisions of the GPL or the LGPL are applicable instead
30 # of those above. If you wish to allow use of your version of this file only
31 # under the terms of either the GPL or the LGPL, and not to allow others to
32 # use your version of this file under the terms of the MPL, indicate your
33 # decision by deleting the provisions above and replace them with the notice
34 # and other provisions required by the GPL or the LGPL. If you do not delete
35 # the provisions above, a recipient may use your version of this file under
36 # the terms of any one of the MPL, the GPL or the LGPL.
38 # ***** END LICENSE BLOCK *****
40 source $TEST_DIR/bin
/library.sh
41 source $TEST_DIR/bin
/set-build-env.sh $@
43 if [[ -z "$BUILDTREE" ]]; then
44 error
"source tree not specified!" $LINENO
47 if [[ "$branch" == "1.9.1" ]]; then
49 if [[ -z "$TEST_MOZILLA_HG" ]]; then
50 error
"environment variable TEST_MOZILLA_HG must be set to the hg repository for branch 1.9.1"
53 # maintain a local copy of the hg repository
54 # clone specific trees from it.
56 TEST_MOZILLA_HG_LOCAL
=${TEST_MOZILLA_HG_LOCAL:-$BUILDDIR/hg.mozilla.org/`basename $TEST_MOZILLA_HG`}
58 if [[ ! -d $BUILDDIR/hg.mozilla.org
]]; then
59 mkdir
$BUILDDIR/hg.mozilla.org
62 if [[ ! -d $TEST_MOZILLA_HG_LOCAL ]]; then
63 if ! hg clone
$TEST_MOZILLA_HG $TEST_MOZILLA_HG_LOCAL; then
64 error
"during hg clone of $TEST_MOZILLA_HG" $LINENO
68 cd $TEST_MOZILLA_HG_LOCAL
71 echo "`hg root` id `hg id`"
80 if [[ ! ( -d mozilla
&& \
81 -e mozilla
/client.mk
&& \
82 -e "mozilla/$project/config/mozconfig" ) ]]; then
83 if ! eval cvs
-z3 -q co
$MOZ_CO_FLAGS $BRANCH_CO_FLAGS $DATE_CO_FLAGS \
84 mozilla
/client.mk mozilla
/$project/config
/mozconfig
; then
85 error
"during checkout of $project mozconfig" $LINENO
88 if ! $buildbash $bashlogin -c "cd $BUILDTREE/mozilla; make -f client.mk checkout" 2>&1; then
89 error
"during checkout of $project tree" $LINENO
95 if [[ ! -d mozilla
/.hg
]]; then
96 if ! hg clone
$TEST_MOZILLA_HG_LOCAL $BUILDTREE/mozilla
; then
97 error
"during hg clone of $TEST_MOZILLA_HG_LOCAL" $LINENO
105 hg update
-r $TEST_MOZILLA_HG_REV
107 echo "`hg root` id `hg id`"
109 if [[ -n "$DATE_CO_FLAGS" ]]; then
110 eval hg update
$DATE_CO_FLAGS
111 echo "Update to date $MOZ_CO_DATE `hg root` id `hg id`"
114 # do not use mozilla-build on windows systems as we
115 # must use the cygwin python with the cygwin mercurial.
117 if ! python client.py checkout
; then
118 error
"during checkout of $project tree" $LINENO
123 error
"branch $branch not yet supported"
132 if [[ ! ( -d mozilla
&& \
133 -e mozilla
/client.mk
&& \
134 -e "mozilla/$project/config/mozconfig" ) ]]; then
135 if ! eval cvs
-z3 -q co
$MOZ_CO_FLAGS $BRANCH_CO_FLAGS $DATE_CO_FLAGS \
136 mozilla
/client.mk mozilla
/$project/config
/mozconfig
; then
137 error
"during checkout of $MOZ_CO_FLAGS $BRANCH_CO_FLAGS $DATE_CO_FLAGS $project mozconfig" $LINENO
141 if [[ ! ( -d mozilla
&& \
142 -e mozilla
/client.mk
&& \
143 -e "mozilla/browser/config/mozconfig" ) ]]; then
144 if ! eval cvs
-z3 -q co
$MOZ_CO_FLAGS $BRANCH_CO_FLAGS $DATE_CO_FLAGS \
145 mozilla
/client.mk mozilla
/browser
/config
/mozconfig
; then
146 error
"during checkout of $MOZ_CO_FLAGS $BRANCH_CO_FLAGS $DATE_CO_FLAGS browser mozconfig" $LINENO
150 if ! $buildbash $bashlogin -c "cd $BUILDTREE/mozilla; make -f client.mk checkout" 2>&1; then
151 error
"during checkout of $project tree" $LINENO
156 if [[ ! -d mozilla
/.hg
]]; then
157 if ! hg clone
$TEST_MOZILLA_HG_LOCAL $BUILDTREE/mozilla
; then
158 error
"during hg clone of $TEST_MOZILLA_HG_LOCAL" $LINENO
166 hg update
-r $TEST_MOZILLA_HG_REV
168 echo "`hg root` id `hg id`"
170 if [[ -n "$DATE_CO_FLAGS" ]]; then
171 eval hg update
$DATE_CO_FLAGS
172 echo "Update to date $MOZ_CO_DATE `hg root` id `hg id`"
176 # do not use mozilla-build on windows systems as we
177 # must use the cygwin python with the cygwin mercurial.
179 if ! python client.py checkout
; then
180 error
"during checkout of $project tree" $LINENO
185 error
"branch $branch not yet supported"
194 if [[ ! -d mozilla
/.hg
]]; then
195 if ! hg clone
$TEST_MOZILLA_HG_LOCAL $BUILDTREE/mozilla
; then
196 error
"during hg clone of $TEST_MOZILLA_HG_LOCAL" $LINENO
200 # XXX need to generalize the mobile-browser repository
201 if [[ ! -d mozilla
/mobile
/.hg
]]; then
202 if ! hg clone http
://hg.mozilla.org
/mobile-browser
$BUILDTREE/mozilla
/mobile
; then
203 error
"during hg clone of http://hg.mozilla.org/mobile-browser" $LINENO
211 hg update
-r $TEST_MOZILLA_HG_REV
213 echo "`hg root` id `hg id`"
215 if [[ -n "$DATE_CO_FLAGS" ]]; then
216 eval hg update
$DATE_CO_FLAGS
217 echo "Update to date $MOZ_CO_DATE `hg root` id `hg id`"
224 # XXX need to deal with mobile revisions from different repositories
228 # do not use mozilla-build on windows systems as we
229 # must use the cygwin python with the cygwin mercurial.
231 if ! python client.py checkout
; then
232 error
"during checkout of $project tree" $LINENO
237 error
"branch $branch not yet supported"
246 if [[ ! ( -d mozilla
&& \
248 -e mozilla
/js
/src
) ]]; then
249 if ! eval cvs
-z3 -q co
$MOZ_CO_FLAGS $BRANCH_CO_FLAGS $DATE_CO_FLAGS mozilla
/js
; then
250 error
"during initial co $MOZ_CO_FLAGS $BRANCH_CO_FLAGS $DATE_CO_FLAGS mozilla/js"
256 if ! eval cvs
-z3 -q update
$MOZ_CO_FLAGS $BRANCH_CO_FLAGS $DATE_CO_FLAGS -d -P 2>&1; then
257 error
"during update $MOZ_CO_FLAGS $BRANCH_CO_FLAGS $DATE_CO_FLAGS js/src" $LINENO
260 if ! cvs
-z3 -q update
-d -P -A editline config
2>&1; then
261 error
"during checkout of js/src" $LINENO
267 if [[ ! -d mozilla
/.hg
]]; then
268 if ! hg clone
$TEST_MOZILLA_HG_LOCAL $BUILDTREE/mozilla
; then
269 error
"during hg clone of $TEST_MOZILLA_HG_LOCAL" $LINENO
277 hg update
-r $TEST_MOZILLA_HG_REV
279 echo "`hg root` id `hg id`"
281 if [[ -n "$DATE_CO_FLAGS" ]]; then
282 eval hg update
$DATE_CO_FLAGS
283 echo "Update to date $MOZ_CO_DATE `hg root` id `hg id`"
287 # do not use mozilla-build on windows systems as we
288 # must use the cygwin python with the cygwin mercurial.
290 if ! python client.py checkout
; then
291 error
"during checkout of $project tree" $LINENO
298 error
"branch $branch not yet supported"
304 error
"unknown product $product" $LINENO