annotate get_source.sh @ 2369:d43cf567cf72 jdk8u212-b04

Added tag jdk8u212-b03 for changeset 5218ef8ea6c3
author andrew
date Wed, 03 Apr 2019 05:14:53 +0100
parents abafc84654a6
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
274
dc9eb519c6ed 7003845: README-builds document proper location of forest extension, provide alternatives
ohair
parents:
diff changeset
1 #!/bin/sh
dc9eb519c6ed 7003845: README-builds document proper location of forest extension, provide alternatives
ohair
parents:
diff changeset
2
dc9eb519c6ed 7003845: README-builds document proper location of forest extension, provide alternatives
ohair
parents:
diff changeset
3 #
1094
406ecd8cce66 8047925: Add mercurial version checks to get_source.sh
mduigou
parents: 613
diff changeset
4 # Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
274
dc9eb519c6ed 7003845: README-builds document proper location of forest extension, provide alternatives
ohair
parents:
diff changeset
5 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
dc9eb519c6ed 7003845: README-builds document proper location of forest extension, provide alternatives
ohair
parents:
diff changeset
6 #
dc9eb519c6ed 7003845: README-builds document proper location of forest extension, provide alternatives
ohair
parents:
diff changeset
7 # This code is free software; you can redistribute it and/or modify it
dc9eb519c6ed 7003845: README-builds document proper location of forest extension, provide alternatives
ohair
parents:
diff changeset
8 # under the terms of the GNU General Public License version 2 only, as
dc9eb519c6ed 7003845: README-builds document proper location of forest extension, provide alternatives
ohair
parents:
diff changeset
9 # published by the Free Software Foundation. Oracle designates this
dc9eb519c6ed 7003845: README-builds document proper location of forest extension, provide alternatives
ohair
parents:
diff changeset
10 # particular file as subject to the "Classpath" exception as provided
dc9eb519c6ed 7003845: README-builds document proper location of forest extension, provide alternatives
ohair
parents:
diff changeset
11 # by Oracle in the LICENSE file that accompanied this code.
dc9eb519c6ed 7003845: README-builds document proper location of forest extension, provide alternatives
ohair
parents:
diff changeset
12 #
dc9eb519c6ed 7003845: README-builds document proper location of forest extension, provide alternatives
ohair
parents:
diff changeset
13 # This code is distributed in the hope that it will be useful, but WITHOUT
dc9eb519c6ed 7003845: README-builds document proper location of forest extension, provide alternatives
ohair
parents:
diff changeset
14 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
dc9eb519c6ed 7003845: README-builds document proper location of forest extension, provide alternatives
ohair
parents:
diff changeset
15 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
dc9eb519c6ed 7003845: README-builds document proper location of forest extension, provide alternatives
ohair
parents:
diff changeset
16 # version 2 for more details (a copy is included in the LICENSE file that
dc9eb519c6ed 7003845: README-builds document proper location of forest extension, provide alternatives
ohair
parents:
diff changeset
17 # accompanied this code).
dc9eb519c6ed 7003845: README-builds document proper location of forest extension, provide alternatives
ohair
parents:
diff changeset
18 #
dc9eb519c6ed 7003845: README-builds document proper location of forest extension, provide alternatives
ohair
parents:
diff changeset
19 # You should have received a copy of the GNU General Public License version
dc9eb519c6ed 7003845: README-builds document proper location of forest extension, provide alternatives
ohair
parents:
diff changeset
20 # 2 along with this work; if not, write to the Free Software Foundation,
dc9eb519c6ed 7003845: README-builds document proper location of forest extension, provide alternatives
ohair
parents:
diff changeset
21 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
dc9eb519c6ed 7003845: README-builds document proper location of forest extension, provide alternatives
ohair
parents:
diff changeset
22 #
dc9eb519c6ed 7003845: README-builds document proper location of forest extension, provide alternatives
ohair
parents:
diff changeset
23 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
dc9eb519c6ed 7003845: README-builds document proper location of forest extension, provide alternatives
ohair
parents:
diff changeset
24 # or visit www.oracle.com if you need additional information or have any
dc9eb519c6ed 7003845: README-builds document proper location of forest extension, provide alternatives
ohair
parents:
diff changeset
25 # questions.
dc9eb519c6ed 7003845: README-builds document proper location of forest extension, provide alternatives
ohair
parents:
diff changeset
26 #
dc9eb519c6ed 7003845: README-builds document proper location of forest extension, provide alternatives
ohair
parents:
diff changeset
27
1095
ec58dd8b23b6 8048184: handle mercurial dev build version string
mduigou
parents: 1094
diff changeset
28 to_stderr() {
ec58dd8b23b6 8048184: handle mercurial dev build version string
mduigou
parents: 1094
diff changeset
29 echo "$@" >&2
ec58dd8b23b6 8048184: handle mercurial dev build version string
mduigou
parents: 1094
diff changeset
30 }
ec58dd8b23b6 8048184: handle mercurial dev build version string
mduigou
parents: 1094
diff changeset
31
ec58dd8b23b6 8048184: handle mercurial dev build version string
mduigou
parents: 1094
diff changeset
32 error() {
ec58dd8b23b6 8048184: handle mercurial dev build version string
mduigou
parents: 1094
diff changeset
33 to_stderr "ERROR: $1"
ec58dd8b23b6 8048184: handle mercurial dev build version string
mduigou
parents: 1094
diff changeset
34 exit ${2:-126}
ec58dd8b23b6 8048184: handle mercurial dev build version string
mduigou
parents: 1094
diff changeset
35 }
ec58dd8b23b6 8048184: handle mercurial dev build version string
mduigou
parents: 1094
diff changeset
36
ec58dd8b23b6 8048184: handle mercurial dev build version string
mduigou
parents: 1094
diff changeset
37 warning() {
ec58dd8b23b6 8048184: handle mercurial dev build version string
mduigou
parents: 1094
diff changeset
38 to_stderr "WARNING: $1"
ec58dd8b23b6 8048184: handle mercurial dev build version string
mduigou
parents: 1094
diff changeset
39 }
ec58dd8b23b6 8048184: handle mercurial dev build version string
mduigou
parents: 1094
diff changeset
40
ec58dd8b23b6 8048184: handle mercurial dev build version string
mduigou
parents: 1094
diff changeset
41 version_field() {
ec58dd8b23b6 8048184: handle mercurial dev build version string
mduigou
parents: 1094
diff changeset
42 # rev is typically omitted for minor and major releases
ec58dd8b23b6 8048184: handle mercurial dev build version string
mduigou
parents: 1094
diff changeset
43 field=`echo ${1}.0 | cut -f ${2} -d .`
ec58dd8b23b6 8048184: handle mercurial dev build version string
mduigou
parents: 1094
diff changeset
44 if expr 1 + $field >/dev/null 2> /dev/null; then
ec58dd8b23b6 8048184: handle mercurial dev build version string
mduigou
parents: 1094
diff changeset
45 echo $field
ec58dd8b23b6 8048184: handle mercurial dev build version string
mduigou
parents: 1094
diff changeset
46 else
ec58dd8b23b6 8048184: handle mercurial dev build version string
mduigou
parents: 1094
diff changeset
47 echo -1
ec58dd8b23b6 8048184: handle mercurial dev build version string
mduigou
parents: 1094
diff changeset
48 fi
ec58dd8b23b6 8048184: handle mercurial dev build version string
mduigou
parents: 1094
diff changeset
49 }
ec58dd8b23b6 8048184: handle mercurial dev build version string
mduigou
parents: 1094
diff changeset
50
1094
406ecd8cce66 8047925: Add mercurial version checks to get_source.sh
mduigou
parents: 613
diff changeset
51 # Version check
406ecd8cce66 8047925: Add mercurial version checks to get_source.sh
mduigou
parents: 613
diff changeset
52
406ecd8cce66 8047925: Add mercurial version checks to get_source.sh
mduigou
parents: 613
diff changeset
53 # required
406ecd8cce66 8047925: Add mercurial version checks to get_source.sh
mduigou
parents: 613
diff changeset
54 reqdmajor=1
1095
ec58dd8b23b6 8048184: handle mercurial dev build version string
mduigou
parents: 1094
diff changeset
55 reqdminor=4
1094
406ecd8cce66 8047925: Add mercurial version checks to get_source.sh
mduigou
parents: 613
diff changeset
56 reqdrev=0
406ecd8cce66 8047925: Add mercurial version checks to get_source.sh
mduigou
parents: 613
diff changeset
57
406ecd8cce66 8047925: Add mercurial version checks to get_source.sh
mduigou
parents: 613
diff changeset
58 # requested
406ecd8cce66 8047925: Add mercurial version checks to get_source.sh
mduigou
parents: 613
diff changeset
59 rqstmajor=2
406ecd8cce66 8047925: Add mercurial version checks to get_source.sh
mduigou
parents: 613
diff changeset
60 rqstminor=6
406ecd8cce66 8047925: Add mercurial version checks to get_source.sh
mduigou
parents: 613
diff changeset
61 rqstrev=3
406ecd8cce66 8047925: Add mercurial version checks to get_source.sh
mduigou
parents: 613
diff changeset
62
1095
ec58dd8b23b6 8048184: handle mercurial dev build version string
mduigou
parents: 1094
diff changeset
63
1094
406ecd8cce66 8047925: Add mercurial version checks to get_source.sh
mduigou
parents: 613
diff changeset
64 # installed
1095
ec58dd8b23b6 8048184: handle mercurial dev build version string
mduigou
parents: 1094
diff changeset
65 hgwhere="`command -v hg`"
1094
406ecd8cce66 8047925: Add mercurial version checks to get_source.sh
mduigou
parents: 613
diff changeset
66 if [ "x$hgwhere" = "x" ]; then
1095
ec58dd8b23b6 8048184: handle mercurial dev build version string
mduigou
parents: 1094
diff changeset
67 error "Could not locate Mercurial command"
1094
406ecd8cce66 8047925: Add mercurial version checks to get_source.sh
mduigou
parents: 613
diff changeset
68 fi
406ecd8cce66 8047925: Add mercurial version checks to get_source.sh
mduigou
parents: 613
diff changeset
69
1821
abafc84654a6 8055772: get_source.sh : version check assumes English localization
mduigou
parents: 1095
diff changeset
70 hgversion="`LANGUAGE=en hg --version 2> /dev/null | sed -n -e 's@^Mercurial Distributed SCM (version \([^+]*\).*)\$@\1@p'`"
1094
406ecd8cce66 8047925: Add mercurial version checks to get_source.sh
mduigou
parents: 613
diff changeset
71 if [ "x${hgversion}" = "x" ] ; then
1095
ec58dd8b23b6 8048184: handle mercurial dev build version string
mduigou
parents: 1094
diff changeset
72 error "Could not determine Mercurial version of $hgwhere"
1094
406ecd8cce66 8047925: Add mercurial version checks to get_source.sh
mduigou
parents: 613
diff changeset
73 fi
406ecd8cce66 8047925: Add mercurial version checks to get_source.sh
mduigou
parents: 613
diff changeset
74
1095
ec58dd8b23b6 8048184: handle mercurial dev build version string
mduigou
parents: 1094
diff changeset
75 hgmajor="`version_field $hgversion 1`"
ec58dd8b23b6 8048184: handle mercurial dev build version string
mduigou
parents: 1094
diff changeset
76 hgminor="`version_field $hgversion 2`"
ec58dd8b23b6 8048184: handle mercurial dev build version string
mduigou
parents: 1094
diff changeset
77 hgrev="`version_field $hgversion 3`"
ec58dd8b23b6 8048184: handle mercurial dev build version string
mduigou
parents: 1094
diff changeset
78
ec58dd8b23b6 8048184: handle mercurial dev build version string
mduigou
parents: 1094
diff changeset
79 if [ $hgmajor -eq -1 -o $hgminor -eq -1 -o $hgrev -eq -1 ] ; then
ec58dd8b23b6 8048184: handle mercurial dev build version string
mduigou
parents: 1094
diff changeset
80 error "Could not determine Mercurial version of $hgwhere from \"$hgversion\""
ec58dd8b23b6 8048184: handle mercurial dev build version string
mduigou
parents: 1094
diff changeset
81 fi
ec58dd8b23b6 8048184: handle mercurial dev build version string
mduigou
parents: 1094
diff changeset
82
1094
406ecd8cce66 8047925: Add mercurial version checks to get_source.sh
mduigou
parents: 613
diff changeset
83
406ecd8cce66 8047925: Add mercurial version checks to get_source.sh
mduigou
parents: 613
diff changeset
84 # Require
406ecd8cce66 8047925: Add mercurial version checks to get_source.sh
mduigou
parents: 613
diff changeset
85 if [ $hgmajor -lt $reqdmajor -o \( $hgmajor -eq $reqdmajor -a $hgminor -lt $reqdminor \) -o \( $hgmajor -eq $reqdmajor -a $hgminor -eq $reqdminor -a $hgrev -lt $reqdrev \) ] ; then
1095
ec58dd8b23b6 8048184: handle mercurial dev build version string
mduigou
parents: 1094
diff changeset
86 error "Mercurial version $reqdmajor.$reqdminor.$reqdrev or later is required. $hgwhere is version $hgversion"
1094
406ecd8cce66 8047925: Add mercurial version checks to get_source.sh
mduigou
parents: 613
diff changeset
87 fi
406ecd8cce66 8047925: Add mercurial version checks to get_source.sh
mduigou
parents: 613
diff changeset
88
1095
ec58dd8b23b6 8048184: handle mercurial dev build version string
mduigou
parents: 1094
diff changeset
89
1094
406ecd8cce66 8047925: Add mercurial version checks to get_source.sh
mduigou
parents: 613
diff changeset
90 # Request
406ecd8cce66 8047925: Add mercurial version checks to get_source.sh
mduigou
parents: 613
diff changeset
91 if [ $hgmajor -lt $rqstmajor -o \( $hgmajor -eq $rqstmajor -a $hgminor -lt $rqstminor \) -o \( $hgmajor -eq $rqstmajor -a $hgminor -eq $rqstminor -a $hgrev -lt $rqstrev \) ] ; then
1095
ec58dd8b23b6 8048184: handle mercurial dev build version string
mduigou
parents: 1094
diff changeset
92 warning "Mercurial version $rqstmajor.$rqstminor.$rqstrev or later is recommended. $hgwhere is version $hgversion"
1094
406ecd8cce66 8047925: Add mercurial version checks to get_source.sh
mduigou
parents: 613
diff changeset
93 fi
406ecd8cce66 8047925: Add mercurial version checks to get_source.sh
mduigou
parents: 613
diff changeset
94
1095
ec58dd8b23b6 8048184: handle mercurial dev build version string
mduigou
parents: 1094
diff changeset
95
1094
406ecd8cce66 8047925: Add mercurial version checks to get_source.sh
mduigou
parents: 613
diff changeset
96 # Get clones of all absent nested repositories (harmless if already exist)
406ecd8cce66 8047925: Add mercurial version checks to get_source.sh
mduigou
parents: 613
diff changeset
97 sh ./common/bin/hgforest.sh clone "$@" || exit $?
274
dc9eb519c6ed 7003845: README-builds document proper location of forest extension, provide alternatives
ohair
parents:
diff changeset
98
dc9eb519c6ed 7003845: README-builds document proper location of forest extension, provide alternatives
ohair
parents:
diff changeset
99 # Update all existing repositories to the latest sources
536
8e36a0fabf58 8004145: New improved hgforest.sh, ctrl-c now properly terminates mercurial processes.
ohrstrom
parents: 434
diff changeset
100 sh ./common/bin/hgforest.sh pull -u