summaryrefslogtreecommitdiffhomepage
path: root/subr/pkg_fetch_download.subr
diff options
context:
space:
mode:
authorLucio Andrés Illanes Albornoz <lucio@lucioillanes.de>2021-01-23 10:49:42 +0000
committerLucio Andrés Illanes Albornoz <lucio@lucioillanes.de>2021-01-23 12:07:46 +0000
commitb63b9baad8f41274e844c11bceb38efd20dfb3fe (patch)
tree213dc0bbe3098d15812050d90745ca26c7bcbf9c /subr/pkg_fetch_download.subr
parent7021b880e98abfd0f0805d7e412f62e895201cca (diff)
downloadmidipix_build-b63b9baad8f41274e844c11bceb38efd20dfb3fe.tar.bz2
midipix_build-b63b9baad8f41274e844c11bceb38efd20dfb3fe.tar.xz
Implements setting up & fetching from mirrors.
etc/pkgtool.usage: updated. etc/README.md: updated. pkgtool.sh:pkgtoolp_mirror{,_fetch}(): initial implementation. subr/pkg_fetch_download.subr: default to empty ${PKG_MIRRORS}. subr/pkg_fetch_download.subr: factor out ${ARG_FETCH_FORCE} check and ${BUILD_DLCACHEDIR}. subr/pkgtool_init.subr: updated. subr.rtl/rtl_fetch.subr:rtl_fetch_urls_{git,wget}(): factor out ${ARG_FETCH_FORCE} check and ${BUILD_DLCACHEDIR}; minor cleanup. subr.rtl/rtl_fetch.subr:rtl_fetch_url_wget(): return vs. exit on fatal failure. subr.rtl/rtl_fetch.subr:rtlp_fetch_url_git(): copy only if ${_cache_dname} != ${_tgtdir}. subr.rtl/rtl_fetch.subr:rtlp_fetch_url_git(): return if unable to git-clone(1). subr.rtl/rtl_fetch.subr:{rtlp_fetch_url_git,rtl_fetch_urls_git}(): implement Git repository mirroring. vars/{gcc,python[23]{,_host}}.vars: updated.
Diffstat (limited to 'subr/pkg_fetch_download.subr')
-rw-r--r--subr/pkg_fetch_download.subr16
1 files changed, 9 insertions, 7 deletions
diff --git a/subr/pkg_fetch_download.subr b/subr/pkg_fetch_download.subr
index bfe358f6..75d49f50 100644
--- a/subr/pkg_fetch_download.subr
+++ b/subr/pkg_fetch_download.subr
@@ -3,14 +3,16 @@
#
pkg_fetch_download() {
- if [ -n "${PKG_URL:-}" ]; then
- if ! rtl_fetch_url_wget "${PKG_URL}" "${PKG_SHA256SUM}" "${PKG_FNAME}" "${PKG_NAME}" "${PKG_MIRRORS}"; then
- return 1;
+ if [ "${ARG_FETCH_FORCE:-}" != "offline" ]; then
+ if [ -n "${PKG_URL:-}" ]; then
+ if ! rtl_fetch_url_wget "${PKG_URL}" "${PKG_SHA256SUM}" "${BUILD_DLCACHEDIR}" "${PKG_FNAME}" "${PKG_NAME}" "${PKG_MIRRORS:-}"; then
+ return 1;
+ fi;
fi;
- fi;
- if [ -n "${PKG_URLS_GIT:-}" ]; then
- if ! rtl_fetch_urls_git "${PKG_BASE_DIR}" ${PKG_URLS_GIT}; then
- return 1;
+ if [ -n "${PKG_URLS_GIT:-}" ]; then
+ if ! rtl_fetch_urls_git "${BUILD_DLCACHEDIR}" "${PKG_BASE_DIR}" "${PKG_MIRRORS:-}" ${PKG_URLS_GIT}; then
+ return 1;
+ fi;
fi;
fi;
};