summaryrefslogtreecommitdiffhomepage
path: root/subr/pkg_fetch_wget.subr
diff options
context:
space:
mode:
Diffstat (limited to 'subr/pkg_fetch_wget.subr')
-rw-r--r--subr/pkg_fetch_wget.subr35
1 files changed, 2 insertions, 33 deletions
diff --git a/subr/pkg_fetch_wget.subr b/subr/pkg_fetch_wget.subr
index 95fdc081..56fe79d3 100644
--- a/subr/pkg_fetch_wget.subr
+++ b/subr/pkg_fetch_wget.subr
@@ -2,40 +2,9 @@
# set -o errexit -o noglob are assumed.
#
-# N.B. URLs ($1) may contain `?' or '&' characters.
-pkgp_fetch_wget() {
- local _url="${1}" _sha256sum_src="${2}";
- if [ -z "${3}" ]; then
- _url_dst="${DLCACHEDIR}/$(ex_basename "${_url}")";
- else
- _url_dst="${DLCACHEDIR}/${3}";
- fi;
- if [ "${ARG_OFFLINE:-0}" -eq 1 ]\
- || [ -e "${_url_dst}.fetched" ]; then
- return 0;
- else
- wget ${DEFAULT_WGET_ARGS} -c -O "${_url_dst}" "${_url}";
- fi;
- if [ -n "${_sha256sum_src}" ]; then
- set -- $(openssl dgst -sha256 "${_url_dst}"); shift $((${#}-1));
- if [ "${_sha256sum_dst:=${1}}" != "${_sha256sum_src}" ]; then
- if [ "${ARG_IGNORE_SHA256SUMS:-0}" -eq 0 ]; then
- ex_log_msg failexit "Error: hash mismatch for URL \`${_url}' (is: ${_sha256sum_dst}, should be: ${_sha256sum_src}.)";
- else
- ex_log_msg vnfo "Warning: hash mismatch for URL \`${_url}' (is: ${_sha256sum_dst}, should be: ${_sha256sum_src}.)";
- fi;
- fi;
- fi;
- touch "${_url_dst}.fetched";
-};
-
pkg_fetch_wget() {
- if [ -n "${1}" ]; then
- pkgp_fetch_wget "${1}" "${2}";
- else
- if [ -n "${PKG_URL}" ]; then
- pkgp_fetch_wget "${PKG_URL}" "${PKG_SHA256SUM}" "${PKG_FNAME}";
- fi;
+ if [ -n "${PKG_URL}" ]; then
+ ex_rtl_fetch_url_wget "${PKG_URL}" "${PKG_SHA256SUM}" "${PKG_FNAME}";
fi;
};