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