author | Alan Coopersmith <Alan.Coopersmith@Oracle.COM> |
Wed, 07 Mar 2012 19:14:00 -0800 | |
changeset 1252 | ab8d8ab60287 |
parent 1027 | 4a07a085ca64 |
child 1466 | fbd4067be4c6 |
permissions | -rwxr-xr-x |
496
b88fb0eea032
Make download-tarballs more Indiana-compatible:
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
98
diff
changeset
|
1 |
#!/bin/ksh93 |
0
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
2 |
# |
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
3 |
########################################################################### |
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
4 |
# |
943
294f64612d23
6948254 Mass update of X gate sources to Oracle copyright format
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
919
diff
changeset
|
5 |
# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. |
0
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
6 |
# |
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
7 |
# Permission is hereby granted, free of charge, to any person obtaining a |
919
425233ae7236
6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
911
diff
changeset
|
8 |
# copy of this software and associated documentation files (the "Software"), |
425233ae7236
6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
911
diff
changeset
|
9 |
# to deal in the Software without restriction, including without limitation |
425233ae7236
6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
911
diff
changeset
|
10 |
# the rights to use, copy, modify, merge, publish, distribute, sublicense, |
425233ae7236
6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
911
diff
changeset
|
11 |
# and/or sell copies of the Software, and to permit persons to whom the |
425233ae7236
6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
911
diff
changeset
|
12 |
# Software is furnished to do so, subject to the following conditions: |
0
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
13 |
# |
919
425233ae7236
6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
911
diff
changeset
|
14 |
# The above copyright notice and this permission notice (including the next |
425233ae7236
6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
911
diff
changeset
|
15 |
# paragraph) shall be included in all copies or substantial portions of the |
425233ae7236
6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
911
diff
changeset
|
16 |
# Software. |
0
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
17 |
# |
919
425233ae7236
6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
911
diff
changeset
|
18 |
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
425233ae7236
6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
911
diff
changeset
|
19 |
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
425233ae7236
6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
911
diff
changeset
|
20 |
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
425233ae7236
6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
911
diff
changeset
|
21 |
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
425233ae7236
6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
911
diff
changeset
|
22 |
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
425233ae7236
6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
911
diff
changeset
|
23 |
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
425233ae7236
6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
911
diff
changeset
|
24 |
# DEALINGS IN THE SOFTWARE. |
0
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
25 |
# |
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
26 |
########################################################################### |
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
27 |
# |
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
28 |
# |
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
29 |
|
1027
4a07a085ca64
6994566 download-tarballs doesn't work in a fresh clone
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
943
diff
changeset
|
30 |
progname="$0" |
4a07a085ca64
6994566 download-tarballs doesn't work in a fresh clone
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
943
diff
changeset
|
31 |
function fatal_error |
4a07a085ca64
6994566 download-tarballs doesn't work in a fresh clone
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
943
diff
changeset
|
32 |
{ |
4a07a085ca64
6994566 download-tarballs doesn't work in a fresh clone
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
943
diff
changeset
|
33 |
print -u2 "${progname}: ERROR: $*" |
4a07a085ca64
6994566 download-tarballs doesn't work in a fresh clone
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
943
diff
changeset
|
34 |
exit 1 |
4a07a085ca64
6994566 download-tarballs doesn't work in a fresh clone
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
943
diff
changeset
|
35 |
} |
4a07a085ca64
6994566 download-tarballs doesn't work in a fresh clone
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
943
diff
changeset
|
36 |
|
0
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
37 |
CLOBBER=0 |
911
a3e7e197651c
6929667 Automate downloading and verification of tarballs used to build X gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
907
diff
changeset
|
38 |
WGET='/usr/bin/wget' |
0
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
39 |
MAKE_FLAGS="-k" |
496
b88fb0eea032
Make download-tarballs more Indiana-compatible:
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
98
diff
changeset
|
40 |
# Make sure Solaris make, not GNU make, is first in the $PATH |
b88fb0eea032
Make download-tarballs more Indiana-compatible:
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
98
diff
changeset
|
41 |
export PATH=/usr/bin:/usr/ccs/bin |
0
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
42 |
|
911
a3e7e197651c
6929667 Automate downloading and verification of tarballs used to build X gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
907
diff
changeset
|
43 |
set -- $(getopt cn $*) |
496
b88fb0eea032
Make download-tarballs more Indiana-compatible:
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
98
diff
changeset
|
44 |
if [[ $? != 0 ]] ; then |
0
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
45 |
echo USAGE: $0 [-c] [-n] |
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
46 |
exit 2 |
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
47 |
fi |
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
48 |
|
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
49 |
for i in $* ; do |
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
50 |
case $i in |
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
51 |
-c) CLOBBER=1; shift;; |
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
52 |
-n) WGET="echo $WGET"; MAKE_FLAGS="$MAKE_FLAGS -n" ; shift;; |
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
53 |
esac |
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
54 |
done |
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
55 |
|
1027
4a07a085ca64
6994566 download-tarballs doesn't work in a fresh clone
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
943
diff
changeset
|
56 |
make setup || fatal_error "make setup failed: cannot continue" |
4a07a085ca64
6994566 download-tarballs doesn't work in a fresh clone
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
943
diff
changeset
|
57 |
|
0
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
58 |
set -v |
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
59 |
|
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
60 |
cd open-src |
496
b88fb0eea032
Make download-tarballs more Indiana-compatible:
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
98
diff
changeset
|
61 |
if [[ $CLOBBER = 1 ]] ; then |
0
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
62 |
rm -rf tarballs |
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
63 |
fi |
496
b88fb0eea032
Make download-tarballs more Indiana-compatible:
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
98
diff
changeset
|
64 |
if [[ ! -d tarballs ]] ; then |
0
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
65 |
mkdir tarballs |
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
66 |
fi |
1027
4a07a085ca64
6994566 download-tarballs doesn't work in a fresh clone
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
943
diff
changeset
|
67 |
make ${MAKE_FLAGS} download |
0
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
68 |
cd ../.. |
b949c5054bc4
Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff
changeset
|
69 |