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
52 if [[ -z "$TEST_MOZILLA_HG" ]]; then
53 error
"environment variable TEST_MOZILLA_HG must be set to the hg repository for branch $branch"
58 if [[ -n "$TEST_MOZILLA_HG" ]]; then
59 # maintain a local copy of the hg repository
60 # clone specific trees from it.
62 TEST_MOZILLA_HG_LOCAL
=${TEST_MOZILLA_HG_LOCAL:-$BUILDDIR/hg.mozilla.org/`basename $TEST_MOZILLA_HG`}
64 if [[ ! -d $BUILDDIR/hg.mozilla.org
]]; then
65 mkdir
$BUILDDIR/hg.mozilla.org
68 if [[ ! -d $TEST_MOZILLA_HG_LOCAL ]]; then
69 if ! hg clone
$TEST_MOZILLA_HG $TEST_MOZILLA_HG_LOCAL; then
70 error
"during hg clone of $TEST_MOZILLA_HG" $LINENO
74 cd $TEST_MOZILLA_HG_LOCAL
76 if [[ "$OSID" == "nt" ]]; then
77 # remove spurious lock file
78 rm -f $TEST_MOZILLA_HG_LOCAL/.hg
/wlock.lnk
81 echo "`hg root` id `hg id`"
86 if [[ -n "$TEST_MOZILLA_HG" ]]; then
88 if [[ ! -d mozilla
/.hg
]]; then
89 if ! hg clone
$TEST_MOZILLA_HG_LOCAL $BUILDTREE/mozilla
; then
90 error
"during hg clone of $TEST_MOZILLA_HG_LOCAL" $LINENO
96 if [[ "$OSID" == "nt" ]]; then
97 # remove spurious lock file
98 rm -f $TEST_MOZILLA_HG/.hg
/wlock.lnk
102 hg update
-r $TEST_MOZILLA_HG_REV
104 echo "`hg root` id `hg id`"
106 if [[ -n "$DATE_CO_FLAGS" ]]; then
107 eval hg update
$DATE_CO_FLAGS
108 echo "Update to date $MOZ_CO_DATE `hg root` id `hg id`"
117 if [[ ! ( -d mozilla
&& \
118 -e mozilla
/client.mk
&& \
119 -e "mozilla/$project/config/mozconfig" ) ]]; then
120 if ! eval cvs
-z3 -q co
$MOZ_CO_FLAGS $BRANCH_CO_FLAGS $DATE_CO_FLAGS \
121 mozilla
/client.mk mozilla
/$project/config
/mozconfig
; then
122 error
"during checkout of $project mozconfig" $LINENO
125 if ! $buildbash $bashlogin -c "export PATH=\"$BUILDPATH\"; cd $BUILDTREE/mozilla; make -f client.mk checkout" 2>&1; then
126 error
"during checkout of $project tree" $LINENO
131 # do not use mozilla-build on windows systems as we
132 # must use the cygwin python with the cygwin mercurial.
134 if ! python client.py checkout
; then
135 error
"during checkout of $project tree" $LINENO
145 if [[ ! ( -d mozilla
&& \
147 -e mozilla
/js
/src
) ]]; then
148 if ! eval cvs
-z3 -q co
$MOZ_CO_FLAGS $BRANCH_CO_FLAGS $DATE_CO_FLAGS mozilla
/js
; then
149 error
"during initial co $MOZ_CO_FLAGS $BRANCH_CO_FLAGS $DATE_CO_FLAGS mozilla/js"
155 if ! eval cvs
-z3 -q update
$MOZ_CO_FLAGS $BRANCH_CO_FLAGS $DATE_CO_FLAGS -d -P 2>&1; then
156 error
"during update $MOZ_CO_FLAGS $BRANCH_CO_FLAGS $DATE_CO_FLAGS js/src" $LINENO
159 if ! cvs
-z3 -q update
-d -P -A editline config
2>&1; then
160 error
"during checkout of js/src" $LINENO
166 # do not use mozilla-build on windows systems as we
167 # must use the cygwin python with the cygwin mercurial.
169 if ! python client.py checkout
; then
170 error
"during checkout of $project tree" $LINENO
179 error
"unknown product $product" $LINENO