From 6e41e8fbfcbce3d7d747a73916bb15d92fd9fe83 Mon Sep 17 00:00:00 2001 From: Lucio Andrés Illanes Albornoz Date: Jan 23 2021 18:52:28 +0000 Subject: subr.rtl/rtl_fetch.subr:{rtlp_fetch_url_git,rtl_fetch_urls_git}(): {receive,pass} ${_pkg_name}. subr.rtl/rtl_fetch.subr:rtl_fetch_urls_git(): return 1 on failure from rtlp_fetch_url_git(). subr/pkg_fetch_download.subr: pass ${PKG_NAME} to rtl_fetch_urls_git(). etc/README.md: updated. --- diff --git a/etc/README.md b/etc/README.md index 98760ee..914a953 100644 --- a/etc/README.md +++ b/etc/README.md @@ -581,7 +581,7 @@ VERSION`` and/or ``URLS_GIT``, respectively. | MAKEFLAGS_INSTALL_EXTRA | Additional list of ``make(1)`` flags during package ``make(1)`` installation | | MAKEFLAGS_VERBOSITY | Variable-value pair to pass to ``make(1)`` in order to force echo-back of command lines prior to execution | | MAKE_INSTALL_VNAME | Variable name of ``make(1)`` installation destination directory variable during package ``make(1)`` installation | -| MIRRORS | List of package archive mirror base URLs to attempt downloading from; archive files are expected to reside within ``${PKG_NAME}`` subdirs | +| MIRRORS | List of package archive/repository mirror base URLs to attempt downloading from; cf. ``pkgtool.sh -m `` | | NO_CLEAN | Inhibit cleaning of package build directory beneath ``${PKG_BASE_DIR}`` pre-finish | | NO_CLEAN_BASE_DIR | Inhibit cleaning of package build root directory beneath ``${BUILD_WORKDIR}`` | | NO_LOG_VARS | Inhibit logging of build & package variables pre-package build | diff --git a/subr.rtl/rtl_fetch.subr b/subr.rtl/rtl_fetch.subr index 7f44346..5d21820 100644 --- a/subr.rtl/rtl_fetch.subr +++ b/subr.rtl/rtl_fetch.subr @@ -3,7 +3,7 @@ # rtlp_fetch_url_git() { - local _cache_dname="${1}" _git_branch="${2}" _mirrors="${3}" _subdir="${4}" _tgtdir="${5}" _url="${6}"\ + local _cache_dname="${1}" _git_branch="${2}" _mirrors="${3}" _pkg_name="${4}" _subdir="${5}" _tgtdir="${6}" _url="${7}"\ _clonefl=0 _oldpwd="" _url_base=""; (set -o errexit -o noglob -o nounset; rtl_flock_acquire 4 || exit "${?}"; @@ -15,7 +15,7 @@ rtlp_fetch_url_git() { git submodule update); else for _url_base in ${_url%/*} ${_mirrors}; do - if git clone ${DEFAULT_GIT_ARGS} "${_url_base}/${_url##*/}" "${_cache_dname}/${_subdir}"; then + if git clone ${DEFAULT_GIT_ARGS} "${_url_base}/${_pkg_name}/${_url##*/}" "${_cache_dname}/${_subdir}"; then _clonefl=1; break; fi; done; @@ -43,13 +43,15 @@ rtlp_fetch_url_git() { }; rtl_fetch_urls_git() { - local _cache_dname="${1}" _tgtdir="${2}" _mirrors="${3}" _git_branch="" _subdir="" _url="" _url_spec=""; shift 3; + local _cache_dname="${1}" _tgtdir="${2}" _pkg_name="${3}" _mirrors="${4}" _git_branch="" _subdir="" _url="" _url_spec=""; shift 4; for _url_spec in "${@}"; do _subdir="${_url_spec%=*}"; _url="${_url_spec#*=}"; _url="${_url%@*}"; if [ "${_url_spec#*@}" != "${_url_spec}" ]; then _git_branch=${_url_spec#*@}; fi; - rtlp_fetch_url_git "${_cache_dname}" "${_git_branch}" "${_mirrors}" "${_subdir}" "${_tgtdir}" "${_url}"; + if ! rtlp_fetch_url_git "${_cache_dname}" "${_git_branch}" "${_mirrors}" "${_pkg_name}" "${_subdir}" "${_tgtdir}" "${_url}"; then + return 1; + fi; done; }; diff --git a/subr/pkg_fetch_download.subr b/subr/pkg_fetch_download.subr index 75d49f5..93183f8 100644 --- a/subr/pkg_fetch_download.subr +++ b/subr/pkg_fetch_download.subr @@ -10,7 +10,7 @@ pkg_fetch_download() { fi; fi; if [ -n "${PKG_URLS_GIT:-}" ]; then - if ! rtl_fetch_urls_git "${BUILD_DLCACHEDIR}" "${PKG_BASE_DIR}" "${PKG_MIRRORS:-}" ${PKG_URLS_GIT}; then + if ! rtl_fetch_urls_git "${BUILD_DLCACHEDIR}" "${PKG_BASE_DIR}" "${PKG_NAME}" "${PKG_MIRRORS:-}" ${PKG_URLS_GIT}; then return 1; fi; fi;