1 --- make/build-support/build-common.sh.orig Mon Nov 14 16:29:30 2022
2 +++ make/build-support/build-common.sh Mon Nov 14 16:39:40 2022
8 -# Set up the checksum tool to use
11 - if [ -n "${SHASUM:-}" ]; then
15 - if [ -n "$(which sha1sum)" ]; then
18 - elif [ -n "$(which shasum)" ]; then
20 - SHASUM_OPTIONS="-a 1"
22 - error "Can't find shasum or sha1sum"
28 check_arguments "${FUNCNAME}" 1 $#
31 if [ $CYGWIN_OR_MSYS -eq 1 ]; then echo $(cygpath -m $1); else echo "$1"; fi
35 -# Download a file using wget
37 -# wget options can be provided through the WGET_OPTIONS environment
40 -download_using_wget() {
41 - check_arguments "${FUNCNAME}" 2 $#
47 - "${WGET}" ${WGET_OPTIONS} "${url}" -O "${destfile}"
49 - if [ ! ${ret} = 0 ]; then
50 - error "wget exited with exit code ${ret}"
57 -# Download a file using curl
59 -# curl options can be provided through the CURL_OPTIONS environment
62 -download_using_curl() {
63 - check_arguments "${FUNCNAME}" 2 $#
69 - "${CURL}" ${CURL_OPTIONS} "${url}" -o "${destfile}"
71 - if [ ! ${ret} = 0 ]; then
72 - error "curl exited with exit code ${ret}"
81 -# Will attempt to skip the download if the SKIP_DOWNLOAD environment
82 -# variable is set and the destination file already exists
85 - check_arguments "${FUNCNAME}" 2 $#
90 - if [ "${SKIP_DOWNLOAD:-}" != "" -a -r "${destfile}" ]; then
91 - info "Skipping download of ${url}..."
95 - info "Downloading ${url} to ${destfile}"
96 - mkdir -p "$(dirname "${destfile}")"
97 - if [ -n "${WGET}" ]; then
98 - download_using_wget "${url}" "${destfile}"
99 - elif [ -n "${CURL}" ]; then
100 - download_using_curl "${url}" "${destfile}"
102 - error "Cannot find a suitable tool for downloading fils (tried 'wget' and 'curl')"
111 - check_arguments "${FUNCNAME}" 2 $#
114 - local expected="$2"
116 - if [ -n "${SKIP_CHECKSUM_CHECK:-}" ]; then
120 - if [ x"${expected}" = x"" ]; then
121 - error "Expected checksum unexpectedly empty.."
125 - local actual="$("${SHASUM}" ${SHASUM_OPTIONS} "${dest}" | awk '{ print $1; }')"
126 - if [ ! x"${actual}" = x"${expected}" ]; then
127 - error "Checksum mismatch for ${dest}:"
128 - error "Expected: ${expected}"
129 - error "Actual : ${actual}"
135 # Download and checksum a file
137 download_and_checksum() {
142 - download "${url}" "${dest}"
143 - checksum "${dest}" "${shasum}"
144 + rm -f "${dest}"; mkdir -p "`dirname ${dest}`"
145 + ln -s "${USERLAND_ARCHIVES}/`basename ${url}`" "${dest}"
152 rm -rf "${unpackdir}"/*
153 - download "${url}" "${destfile}"
154 + rm -f "${destfile}"; mkdir -p "`dirname ${destfile}`"
155 + ln -s "${USERLAND_ARCHIVES}/`basename ${url}`" "${destfile}"
156 unpack "${destfile}" "${unpackdir}"
162 rm -rf "${unpackdir}"/*
163 - download_and_checksum "${url}" "${destfile}" "${shasum}"
164 + rm -f "${destfile}"; mkdir -p "`dirname ${destfile}`"
165 + ln -s "${USERLAND_ARCHIVES}/`basename ${url}`" "${destfile}"
166 unpack "${destfile}" "${unpackdir}"
169 @@ -320,17 +204,11 @@
170 export TAR_OPTIONS="${TAR_OPTIONS:-}"
171 export UNZIP_CMD="${UNZIP_CMD:-unzip}"
172 export UNZIP_OPTIONS="${UNZIP_OPTIONS:--q} -u"
173 -export WGET="${WGET:-$(which wget)}"
174 -export WGET_OPTIONS="${WGET_OPTIONS:--q}"
175 -export CURL="${CURL:-$(which curl)}"
176 -export CURL_OPTIONS="${CURL_OPTIONS:--s -f -L}"
178 export MAVEN_REPO_URL_BASE="${MAVEN_REPO_URL_BASE:-https://repo1.maven.org/maven2}"
179 export CODE_TOOLS_URL_BASE="${CODE_TOOLS_URL_BASE:-https://git.openjdk.java.net}"
180 export ANT_ARCHIVE_URL_BASE="${ANT_ARCHIVE_URL_BASE:-https://archive.apache.org/dist/ant/binaries}"
185 # Support for Cygwin and MSYS2 (which may identify as MSYS, MINGW32 or MINGW64 (the default))