annotate get_source.sh @ 42658:9b8b24e4fc01

8171137: Avoid warning: -Xint is not compatible with AOT (switching AOT off) Summary: Put all AOT warnings under PrintAOT flag. Reviewed-by: iveresov, dholmes
author kvn
date Mon, 12 Dec 2016 21:56:45 -0800
parents fa3876203ca9
children
rev   line source
ohair@7650 1 #!/bin/sh
ohair@7650 2
ohair@7650 3 #
mduigou@25041 4 # Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
ohair@7650 5 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ohair@7650 6 #
ohair@7650 7 # This code is free software; you can redistribute it and/or modify it
ohair@7650 8 # under the terms of the GNU General Public License version 2 only, as
ohair@7650 9 # published by the Free Software Foundation. Oracle designates this
ohair@7650 10 # particular file as subject to the "Classpath" exception as provided
ohair@7650 11 # by Oracle in the LICENSE file that accompanied this code.
ohair@7650 12 #
ohair@7650 13 # This code is distributed in the hope that it will be useful, but WITHOUT
ohair@7650 14 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ohair@7650 15 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
ohair@7650 16 # version 2 for more details (a copy is included in the LICENSE file that
ohair@7650 17 # accompanied this code).
ohair@7650 18 #
ohair@7650 19 # You should have received a copy of the GNU General Public License version
ohair@7650 20 # 2 along with this work; if not, write to the Free Software Foundation,
ohair@7650 21 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ohair@7650 22 #
ohair@7650 23 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@7650 24 # or visit www.oracle.com if you need additional information or have any
ohair@7650 25 # questions.
ohair@7650 26 #
ohair@7650 27
mduigou@25317 28 to_stderr() {
mduigou@25317 29 echo "$@" >&2
mduigou@25317 30 }
mduigou@25317 31
mduigou@25317 32 error() {
mduigou@25317 33 to_stderr "ERROR: $1"
mduigou@25317 34 exit ${2:-126}
mduigou@25317 35 }
mduigou@25317 36
mduigou@25317 37 warning() {
mduigou@25317 38 to_stderr "WARNING: $1"
mduigou@25317 39 }
mduigou@25317 40
mduigou@25317 41 version_field() {
mduigou@25317 42 # rev is typically omitted for minor and major releases
mduigou@25317 43 field=`echo ${1}.0 | cut -f ${2} -d .`
mduigou@25317 44 if expr 1 + $field >/dev/null 2> /dev/null; then
mduigou@25317 45 echo $field
mduigou@25317 46 else
mduigou@25317 47 echo -1
mduigou@25317 48 fi
mduigou@25317 49 }
mduigou@25317 50
mduigou@25041 51 # Version check
mduigou@25041 52
mduigou@25041 53 # required
mduigou@25041 54 reqdmajor=1
mduigou@25317 55 reqdminor=4
mduigou@25041 56 reqdrev=0
mduigou@25041 57
mduigou@25041 58 # requested
mduigou@25041 59 rqstmajor=2
mduigou@25041 60 rqstminor=6
mduigou@25041 61 rqstrev=3
mduigou@25041 62
mduigou@25317 63
mduigou@25041 64 # installed
mduigou@25317 65 hgwhere="`command -v hg`"
mduigou@25041 66 if [ "x$hgwhere" = "x" ]; then
mduigou@25317 67 error "Could not locate Mercurial command"
mduigou@25041 68 fi
mduigou@25041 69
mduigou@26117 70 hgversion="`LANGUAGE=en hg --version 2> /dev/null | sed -n -e 's@^Mercurial Distributed SCM (version \([^+]*\).*)\$@\1@p'`"
mduigou@25041 71 if [ "x${hgversion}" = "x" ] ; then
mduigou@25317 72 error "Could not determine Mercurial version of $hgwhere"
mduigou@25041 73 fi
mduigou@25041 74
mduigou@25317 75 hgmajor="`version_field $hgversion 1`"
mduigou@25317 76 hgminor="`version_field $hgversion 2`"
mduigou@25317 77 hgrev="`version_field $hgversion 3`"
mduigou@25317 78
mduigou@25317 79 if [ $hgmajor -eq -1 -o $hgminor -eq -1 -o $hgrev -eq -1 ] ; then
mduigou@25317 80 error "Could not determine Mercurial version of $hgwhere from \"$hgversion\""
mduigou@25317 81 fi
mduigou@25317 82
mduigou@25041 83
mduigou@25041 84 # Require
mduigou@25041 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
mduigou@25317 86 error "Mercurial version $reqdmajor.$reqdminor.$reqdrev or later is required. $hgwhere is version $hgversion"
mduigou@25041 87 fi
mduigou@25041 88
mduigou@25317 89
mduigou@25041 90 # Request
mduigou@25041 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
mduigou@25317 92 warning "Mercurial version $rqstmajor.$rqstminor.$rqstrev or later is recommended. $hgwhere is version $hgversion"
mduigou@25041 93 fi
mduigou@25041 94
mduigou@25317 95
mduigou@25041 96 # Get clones of all absent nested repositories (harmless if already exist)
mduigou@25041 97 sh ./common/bin/hgforest.sh clone "$@" || exit $?
ohair@7650 98
ohair@7650 99 # Update all existing repositories to the latest sources
ohrstrom@14735 100 sh ./common/bin/hgforest.sh pull -u