download-tarballs
author Alan Coopersmith <Alan.Coopersmith@Sun.COM>
Mon, 15 Mar 2010 13:30:45 -0700
changeset 926 776b160bcc74
parent 919 425233ae7236
child 943 294f64612d23
permissions -rwxr-xr-x
6928973 Remove /usr/sfw/lib/64 symlink from SUNWfreetype2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
#
911
a3e7e197651c 6929667 Automate downloading and verification of tarballs used to build X gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 907
diff changeset
     5
# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
a3e7e197651c 6929667 Automate downloading and verification of tarballs used to build X gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 907
diff changeset
     6
# Use is subject to license terms.
0
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
     7
#
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
     8
# 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
     9
# 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
    10
# 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
    11
# 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
    12
# 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
    13
# 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
    14
#
919
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 911
diff changeset
    15
# 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
    16
# 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
    17
# Software.
0
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    18
#
919
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 911
diff changeset
    19
# 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
    20
# 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
    21
# 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
    22
# 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
    23
# 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
    24
# 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
    25
# DEALINGS IN THE SOFTWARE.
0
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
#
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    30
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    31
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
    32
WGET='/usr/bin/wget'
0
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    33
MAKE_FLAGS="-k"
496
b88fb0eea032 Make download-tarballs more Indiana-compatible:
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 98
diff changeset
    34
# 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
    35
export PATH=/usr/bin:/usr/ccs/bin
0
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    36
911
a3e7e197651c 6929667 Automate downloading and verification of tarballs used to build X gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 907
diff changeset
    37
set -- $(getopt cn $*)
496
b88fb0eea032 Make download-tarballs more Indiana-compatible:
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 98
diff changeset
    38
if [[ $? != 0 ]] ; then
0
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    39
    echo USAGE: $0 [-c] [-n]
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    40
    exit 2
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    41
fi
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    42
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    43
for i in $* ; do 
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    44
    case $i in
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    45
	-c)     CLOBBER=1; shift;;
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    46
	-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
    47
    esac
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    48
done
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    49
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    50
set -v
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    51
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    52
cd open-src
496
b88fb0eea032 Make download-tarballs more Indiana-compatible:
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 98
diff changeset
    53
if [[ $CLOBBER = 1 ]] ; then
0
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    54
    rm -rf tarballs
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    55
fi
496
b88fb0eea032 Make download-tarballs more Indiana-compatible:
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 98
diff changeset
    56
if [[ ! -d tarballs ]] ; then 
0
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    57
    mkdir tarballs
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    58
fi
911
a3e7e197651c 6929667 Automate downloading and verification of tarballs used to build X gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 907
diff changeset
    59
if [[ "$(domainname)" =~ \.sun\.com$ ]] ; then
a3e7e197651c 6929667 Automate downloading and verification of tarballs used to build X gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 907
diff changeset
    60
    export TARBALL_ARCHIVE='http://xserver.sfbay.sun.com/tarballs/'
a3e7e197651c 6929667 Automate downloading and verification of tarballs used to build X gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 907
diff changeset
    61
    export TARBALL_ARCHIVE_SET='yes'
a3e7e197651c 6929667 Automate downloading and verification of tarballs used to build X gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 907
diff changeset
    62
fi
0
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    63
make $MAKE_FLAGS download
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    64
cd ../..
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    65