comparison make/scripts/update_src.sh @ 285:f50545b5e2f1

7150322: Stop using drop source bundles in jaxws Reviewed-by: darcy, ohrstrom
author ohair
date Tue, 06 Mar 2012 16:09:35 -0800
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:70893a063136
1 #
2 # Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 #
5 # This code is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License version 2 only, as
7 # published by the Free Software Foundation. Oracle designates this
8 # particular file as subject to the "Classpath" exception as provided
9 # by Oracle in the LICENSE file that accompanied this code.
10 #
11 # This code is distributed in the hope that it will be useful, but WITHOUT
12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 # version 2 for more details (a copy is included in the LICENSE file that
15 # accompanied this code).
16 #
17 # You should have received a copy of the GNU General Public License version
18 # 2 along with this work; if not, write to the Free Software Foundation,
19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 #
21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 # or visit www.oracle.com if you need additional information or have any
23 # questions.
24 #
25
26 # This script was used to copy the former drop source bundle source into
27 # the repository. Exists as a form of documentation.
28
29 curdir="`(cd . && pwd)`"
30
31 # Whitespace normalizer script is in the top repository.
32 normalizer="perl ${curdir}/../make/scripts/normalizer.pl"
33
34 # Locations for bundle and root of source tree
35 tmp=/tmp
36 srcroot=${curdir}/src
37 mkdir -p ${srcroot}
38
39 # Bundle information
40 drops_dir="/java/devtools/share/jdk8-drops"
41 url1="http://download.java.net/glassfish/components/jax-ws/openjdk/jdk8"
42 bundle1="jdk8-jaxws-2_2-SNAPSHOT-2012_01_11-patched.zip"
43 srcdir1="${srcroot}/share/jaxws_classes"
44 url2="http://download.java.net/glassfish/components/jax-ws/openjdk/jdk8"
45 bundle2="jdk8-jaf-2011_07_22.zip"
46 srcdir2="${srcroot}/share/jaf_classes"
47
48 # Function to get a bundle and explode it and normalize the source files.
49 getBundle() # drops_dir url bundlename bundledestdir srcrootdir
50 {
51 # Get the bundle from drops_dir or downloaded
52 mkdir -p $4
53 rm -f $4/$3
54 if [ -f $1/$3 ] ; then
55 echo "Copy over bundle: $1/$3"
56 cp $1/$3 $4
57 else
58 echo "Downloading bundle: $2/$3"
59 (cd $4 && wget $2/$3)
60 fi
61 # Fail if it does not exist
62 if [ ! -f $4/$3 ] ; then
63 echo "ERROR: Could not get $3"
64 exit 1
65 fi
66 # Wipe it out completely
67 echo "Cleaning up $5"
68 rm -f -r $5
69 mkdir -p $5
70 echo "Unzipping $4/$3"
71 ( cd $5 && unzip -q $4/$3 && mv src/* . && rmdir src && rm LICENSE )
72 # Run whitespace normalizer
73 echo "Normalizing the sources in $5"
74 ( cd $5 && ${normalizer} . )
75 # Delete the bundle and leftover files
76 rm -f $4/$3 $5/filelist
77 }
78
79 # Process the bundles.
80 getBundle "${drops_dir}" "${url1}" "${bundle1}" ${tmp} ${srcdir1}
81 getBundle "${drops_dir}" "${url2}" "${bundle2}" ${tmp} ${srcdir2}
82 echo "Completed bundle extraction."
83 echo " "
84
85 # Appropriate Mercurial commands needed to run:
86 echo "Run: hg addremove src"
87 echo "Run: ksh ../make/scripts/webrev.ksh -N -o ${HOME}/webrev"
88 echo "Get reviewer, get CR, then..."
89 echo "Run: hg commit"
90