12005
|
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/jaxp/1.4.5"
|
|
42 |
bundle1="jaxp145_01.zip"
|
12457
|
43 |
srcdir1="${srcroot}"
|
12005
|
44 |
|
|
45 |
# Function to get a bundle and explode it and normalize the source files.
|
|
46 |
getBundle() # drops_dir url bundlename bundledestdir srcrootdir
|
|
47 |
{
|
|
48 |
# Get the bundle from drops_dir or downloaded
|
|
49 |
mkdir -p $4
|
|
50 |
rm -f $4/$3
|
|
51 |
if [ -f $1/$3 ] ; then
|
|
52 |
echo "Copy over bundle: $1/$3"
|
|
53 |
cp $1/$3 $4
|
|
54 |
else
|
|
55 |
echo "Downloading bundle: $2/$3"
|
|
56 |
(cd $4 && wget $2/$3)
|
|
57 |
fi
|
|
58 |
# Fail if it does not exist
|
|
59 |
if [ ! -f $4/$3 ] ; then
|
|
60 |
echo "ERROR: Could not get $3"
|
|
61 |
exit 1
|
|
62 |
fi
|
|
63 |
# Wipe it out completely
|
|
64 |
echo "Cleaning up $5"
|
|
65 |
rm -f -r $5
|
|
66 |
mkdir -p $5
|
|
67 |
echo "Unzipping $4/$3"
|
|
68 |
( cd $5 && unzip -q $4/$3 && mv src/* . && rmdir src && rm LICENSE )
|
|
69 |
# Run whitespace normalizer
|
|
70 |
echo "Normalizing the sources in $5"
|
|
71 |
( cd $5 && ${normalizer} . )
|
|
72 |
# Delete the bundle and leftover files
|
|
73 |
rm -f $4/$3 $5/filelist
|
|
74 |
}
|
|
75 |
|
|
76 |
# Process the bundles.
|
|
77 |
getBundle "${drops_dir}" "${url1}" "${bundle1}" ${tmp} ${srcdir1}
|
|
78 |
echo "Completed bundle extraction."
|
|
79 |
echo " "
|
|
80 |
|
|
81 |
# Appropriate Mercurial commands needed to run:
|
|
82 |
echo "Run: hg addremove src"
|
|
83 |
echo "Run: ksh ../make/scripts/webrev.ksh -N -o ${HOME}/webrev"
|
|
84 |
echo "Get reviewer, get CR, then..."
|
|
85 |
echo "Run: hg commit"
|
|
86 |
|